01: /*
02: * Copyright (C) The MX4J Contributors.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the MX4J License version 1.0.
06: * See the terms of the MX4J License in the documentation provided with this software.
07: */
08:
09: package javax.management;
10:
11: /**
12: * The QueryExp for an 'or' operation
13: *
14: * @version $Revision: 1.6 $
15: * @serial include
16: */
17: class OrQueryExp extends QueryEval implements QueryExp {
18: private static final long serialVersionUID = 2962973084421716523L;
19:
20: /**
21: * @serial The left-side expression
22: */
23: private QueryExp exp1;
24: /**
25: * @serial The right-side expression
26: */
27: private QueryExp exp2;
28:
29: OrQueryExp(QueryExp exp1, QueryExp exp2) {
30: this .exp1 = exp1;
31: this .exp2 = exp2;
32: }
33:
34: public void setMBeanServer(MBeanServer server) {
35: super .setMBeanServer(server);
36: if (exp1 != null)
37: exp1.setMBeanServer(server);
38: if (exp2 != null)
39: exp2.setMBeanServer(server);
40: }
41:
42: public boolean apply(ObjectName name)
43: throws BadStringOperationException,
44: BadBinaryOpValueExpException,
45: BadAttributeValueExpException, InvalidApplicationException {
46: return exp1.apply(name) || exp2.apply(name);
47: }
48: }
|