|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.base.MBeanHandle
public class MBeanHandle
A reference handle to an MBean keeping itself up-to-date automatically during referent registrations and unregistrations. After use, the handle should be freed to release its resources. The handle is activated after the first call to the getMBean method or after addition of a listener. The renew method tries to restore a lost or released referent.
| Nested Class Summary | |
|---|---|
static class |
MBeanHandle.ClassQueryExp
An inner class for queries of a specific class. |
protected static class |
MBeanHandle.RegistrationFilter
An inner class for registration notifications of a named MBean. |
| Constructor Summary | |
|---|---|
MBeanHandle(MBeanServer server)
Constructs a new handle. |
|
MBeanHandle(MBeanServer server,
MBeanReference ref)
Constructs a new handle for an explicit referent. |
|
MBeanHandle(MBeanServer server,
ObjectName name)
Constructs a new handle with an initial value. |
|
MBeanHandle(MBeanServer server,
String ifname)
Constructs a new handle for a default domain query of a named interface. |
|
MBeanHandle(MBeanServer server,
String ifname,
boolean exact)
Constructs a new handle for a named interface and an optional default domain query. |
|
MBeanHandle(MBeanServer server,
String ifname,
ObjectName name)
Constructs a new handle for a named interface with an initial value and default domain query. |
|
MBeanHandle(MBeanServer server,
String ifname,
ObjectName name,
boolean exact)
Constructs a new handle for a named interface with an initial value and an optional default domain query. |
|
| Method Summary | |
|---|---|
void |
addNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
|
protected void |
finalize()
|
Object |
get()
Gets the referent. |
String |
getClassName()
Gets the class name. |
String |
getInterface()
Gets the MBean interface. |
MBeanReference |
getMBean()
Gets a reference to the referent. |
MBeanServer |
getMBeanServer()
Gets the MBean server. |
MBeanNotificationInfo[] |
getNotificationInfo()
|
ObjectName |
getObjectName()
Gets the object name. |
ObjectName |
getQueryPattern()
Gets the object name or a query pattern of the reference. |
void |
handleNotification(Notification notif,
Object handback)
|
void |
invalidate()
Releases the referent and invalidates this handle. |
boolean |
isRegistered()
Checks whether registered, already unregistered or unregistration is just going on. |
boolean |
isValid()
Checks whether this handle is still valid. |
Set |
queryObjectNames()
Queries for a set of object names matching the query pattern. |
void |
release()
Releases the current referent. |
void |
removeNotificationListener(NotificationListener listener)
|
void |
removeNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
|
void |
renew()
Renews the reference to the referent. |
void |
setInterface(String ifname)
Sets the MBean interface with a default domain query. |
void |
setInterface(String ifname,
boolean exact)
Sets the MBean interface with an optional default query. |
void |
setMBeanServer(MBeanServer server)
Sets the MBean server. |
void |
setQueryPattern(ObjectName name)
Sets the object name or a query pattern of the reference. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MBeanHandle(MBeanServer server)
server - the MBean server.
public MBeanHandle(MBeanServer server,
String ifname)
server - the MBean server.ifname - the class or interface name.
public MBeanHandle(MBeanServer server,
String ifname,
boolean exact)
server - the MBean server.ifname - the class or interface name.exact - no default query if true but an explicit one.
public MBeanHandle(MBeanServer server,
ObjectName name)
server - the MBean server.name - the object name or query pattern of the referent.
public MBeanHandle(MBeanServer server,
String ifname,
ObjectName name)
server - the MBean server.ifname - the class or interface name.name - the object name or query pattern of the referent.
public MBeanHandle(MBeanServer server,
String ifname,
ObjectName name,
boolean exact)
server - the MBean server.ifname - the class or interface name.name - the object name or query pattern of the referent.exact - no default query if true but an explicit one.
public MBeanHandle(MBeanServer server,
MBeanReference ref)
server - the MBean server.ref - the referent of this handle.| Method Detail |
|---|
public Object get()
MBeanReference
get in interface MBeanReferencepublic ObjectName getObjectName()
MBeanReference
getObjectName in interface MBeanReferencepublic String getClassName()
MBeanReference
getClassName in interface MBeanReferencepublic boolean isRegistered()
MBeanReference
isRegistered in interface MBeanReferencepublic MBeanServer getMBeanServer()
MBeanReference
getMBeanServer in interface MBeanReferencepublic void setMBeanServer(MBeanServer server)
server - the MBean server.
public void addNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
addNotificationListener in interface NotificationBroadcaster
public void removeNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
throws ListenerNotFoundException
removeNotificationListener in interface NotificationEmitterListenerNotFoundException
public void removeNotificationListener(NotificationListener listener)
throws ListenerNotFoundException
removeNotificationListener in interface NotificationBroadcasterListenerNotFoundExceptionpublic MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo in interface NotificationBroadcasterpublic MBeanReference getMBean()
public ObjectName getQueryPattern()
public void setQueryPattern(ObjectName name)
name - the object name or a query pattern.public String getInterface()
public void setInterface(String ifname)
ifname - the MBean interface name.
public void setInterface(String ifname,
boolean exact)
ifname - the MBean interface name.exact - no default query if true but an explicit one.public Set queryObjectNames()
public void renew()
public void release()
IllegalStateException - for an invalid handle.public void invalidate()
public boolean isValid()
public void handleNotification(Notification notif,
Object handback)
handleNotification in interface NotificationListenerprotected void finalize()
finalize in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||