Savarese.Org

org.savarese.unicorn.ui
Interface ObjectPanelModel<O>

All Known Implementing Classes:
AbstractObjectPanelModel, JavaBeanPanelModel, MBeanPanelModel, WebServicePanelModel

public interface ObjectPanelModel<O>

Interface for adapting objects for use by ObjectPanel.


Method Summary
 void addObjectPanelModelListener(ObjectPanelModelListener<O> listener)
          Adds an ObjectPanelModelListener to the model.
 java.lang.Object getAttribute(java.lang.String attribute)
          Retrieves a named attribute from the adapted object.
 O getObject()
          Retrieves the object adapted to the interface.
 javax.management.MBeanInfo getObjectInfo()
          Returns a description of the object.
 java.lang.String getObjectName()
          Returns a string that identifies the object.
 java.lang.Object invoke(java.lang.String operation, java.lang.Object[] params, java.lang.Class[] types, java.lang.String[] signature)
          Invokes an operation of the adapted object and returns its result, if any.
 boolean isValid()
          Determines if the model is in a valid state.
 void removeObjectPanelModelListener(ObjectPanelModelListener<O> listener)
          Removes an ObjectPanelModelListener from the model.
 void setAttribute(java.lang.String attribute, java.lang.Object value)
          Sets the value of a named attribute of the adapted object.
 void setObject(O obj)
          Sets the object to be adapted to the interface.
 

Method Detail

setObject

void setObject(O obj)
Sets the object to be adapted to the interface.

Parameters:
obj - The object to be adapted.

getObject

O getObject()
Retrieves the object adapted to the interface.

Returns:
The object adapted to the interface.

getObjectName

java.lang.String getObjectName()
Returns a string that identifies the object.

Returns:
A string that identifies the object.

getObjectInfo

javax.management.MBeanInfo getObjectInfo()
Returns a description of the object.

Returns:
The a description of the object.

isValid

boolean isValid()
Determines if the model is in a valid state. A model may be rendered invalid if it has no object, if an exception is occurs during a remote invocation operation, or any number of reasons specific to the model implementation.

Returns:
True if the model is in a valid state, false if not.

getAttribute

java.lang.Object getAttribute(java.lang.String attribute)
                              throws javax.management.AttributeNotFoundException,
                                     java.lang.Exception
Retrieves a named attribute from the adapted object.

Parameters:
attribute - The name of the attribute to retrieve.
Returns:
The attribute corresponding to the provided name.
Throws:
javax.management.AttributeNotFoundException - If the attribute does not exist.
java.lang.Exception - If an error occurs while retrieving the attribute. An exception may occur while communicating with a remote object, while using reflection, or other reasons specific to the model implementation.

setAttribute

void setAttribute(java.lang.String attribute,
                  java.lang.Object value)
                  throws javax.management.AttributeNotFoundException,
                         java.lang.Exception
Sets the value of a named attribute of the adapted object.

Parameters:
attribute - The name of the attribute to set.
value - The new value of the attribute.
Throws:
javax.management.AttributeNotFoundException - If the attribute does not exist.
java.lang.Exception - If an error occurs while retrieving the attribute. An exception may occur while communicating with a remote object, while using reflection, or other reasons specific to the model implementation.

invoke

java.lang.Object invoke(java.lang.String operation,
                        java.lang.Object[] params,
                        java.lang.Class[] types,
                        java.lang.String[] signature)
                        throws java.lang.Exception
Invokes an operation of the adapted object and returns its result, if any.

Parameters:
operation - The name of the operation to invoke.
params - An array of parameters for the operation.
types - An array containing the types of the operation parameters.
signature - A string representation of the types (i.e., the fully qualified class names) of the operation parameters.
Returns:
The result of the operation, if any.
Throws:
java.lang.Exception - If an unexpected condition arises that prvents the successful invocation of the operation.

addObjectPanelModelListener

void addObjectPanelModelListener(ObjectPanelModelListener<O> listener)
Adds an ObjectPanelModelListener to the model. The listener is notifiied whenever the model changes.

Parameters:
listener - The listener to add.

removeObjectPanelModelListener

void removeObjectPanelModelListener(ObjectPanelModelListener<O> listener)
Removes an ObjectPanelModelListener from the model.

Parameters:
listener - The listener to remove.

Savarese.Org

Copyright © 2006 Daniel F. Savarese. All Rights Reserved.