src/share/classes/javax/management/ValueExp.java

Print this page


   1 /*
   2  * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  63   wasn't so modified.
  64 
  65   We could reconsider this if the Query methods were augmented, for example
  66   with:
  67   AttributeValueExp<Number> numberAttr(String name);
  68   AttributeValueExp<String> stringAttr(String name);
  69   AttributeValueExp<Boolean> booleanAttr(String name);
  70   QueryExp <T> in(ValueExp<T> val, Set<ValueExp<T>> valueSet).
  71   But it's not really clear what numberAttr should do if it finds that the
  72   attribute is not in fact a Number.
  73  */
  74 public interface ValueExp extends java.io.Serializable {
  75 
  76     /**
  77      * Applies the ValueExp on a MBean.
  78      *
  79      * @param name The name of the MBean on which the ValueExp will be applied.
  80      *
  81      * @return  The <CODE>ValueExp</CODE>.
  82      *
  83      * @exception BadStringOperationException
  84      * @exception BadBinaryOpValueExpException
  85      * @exception BadAttributeValueExpException
  86      * @exception InvalidApplicationException
  87      */
  88     public ValueExp apply(ObjectName name)
  89             throws BadStringOperationException, BadBinaryOpValueExpException,
  90                    BadAttributeValueExpException, InvalidApplicationException;
  91 
  92     /**
  93      * Sets the MBean server on which the query is to be performed.
  94      *
  95      * @param s The MBean server on which the query is to be performed.
  96      *
  97      * @deprecated This method is not needed because a
  98      * <code>ValueExp</code> can access the MBean server in which it
  99      * is being evaluated by using {@link QueryEval#getMBeanServer()}.
 100      */
 101     @Deprecated
 102     public  void setMBeanServer(MBeanServer s) ;
 103 }
   1 /*
   2  * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  63   wasn't so modified.
  64 
  65   We could reconsider this if the Query methods were augmented, for example
  66   with:
  67   AttributeValueExp<Number> numberAttr(String name);
  68   AttributeValueExp<String> stringAttr(String name);
  69   AttributeValueExp<Boolean> booleanAttr(String name);
  70   QueryExp <T> in(ValueExp<T> val, Set<ValueExp<T>> valueSet).
  71   But it's not really clear what numberAttr should do if it finds that the
  72   attribute is not in fact a Number.
  73  */
  74 public interface ValueExp extends java.io.Serializable {
  75 
  76     /**
  77      * Applies the ValueExp on a MBean.
  78      *
  79      * @param name The name of the MBean on which the ValueExp will be applied.
  80      *
  81      * @return  The <CODE>ValueExp</CODE>.
  82      *
  83      * @exception BadStringOperationException if an invalid string operation is passed
  84      * @exception BadBinaryOpValueExpException if an invalid expression is passed
  85      * @exception BadAttributeValueExpException if an invalid MBean attribute is passed
  86      * @exception InvalidApplicationException if a subquery expression or qualified attribute expression is passed
  87      */
  88     public ValueExp apply(ObjectName name)
  89             throws BadStringOperationException, BadBinaryOpValueExpException,
  90                    BadAttributeValueExpException, InvalidApplicationException;
  91 
  92     /**
  93      * Sets the MBean server on which the query is to be performed.
  94      *
  95      * @param s The MBean server on which the query is to be performed.
  96      *
  97      * @deprecated This method is not needed because a
  98      * <code>ValueExp</code> can access the MBean server in which it
  99      * is being evaluated by using {@link QueryEval#getMBeanServer()}.
 100      */
 101     @Deprecated
 102     public  void setMBeanServer(MBeanServer s) ;
 103 }