|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.norther.tammi.core.base.MBeanHandle<R>
R
- the referent type.public class MBeanHandle<R>
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<R> 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,
boolean... exact)
Constructs a new handle for a named interface and an optional 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()
|
R |
get()
Gets the referent. |
String |
getClassName()
Gets the class name. |
String |
getInterface()
Gets the MBean interface. |
MBeanReference<R> |
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<ObjectName> |
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,
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, 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, 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<R> ref)
server
- the MBean server.ref
- the referent of this handle.Method Detail |
---|
public R get()
MBeanReference
get
in interface MBeanReference<R>
public ObjectName getObjectName()
MBeanReference
getObjectName
in interface MBeanReference<R>
public String getClassName()
MBeanReference
getClassName
in interface MBeanReference<R>
public boolean isRegistered()
MBeanReference
isRegistered
in interface MBeanReference<R>
public MBeanServer getMBeanServer()
MBeanReference
getMBeanServer
in interface MBeanReference<R>
public 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 NotificationEmitter
ListenerNotFoundException
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
removeNotificationListener
in interface NotificationBroadcaster
ListenerNotFoundException
public MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo
in interface NotificationBroadcaster
public MBeanReference<R> 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, boolean... exact)
ifname
- the MBean interface name.exact
- no default query if true but an explicit one.public Set<ObjectName> 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 NotificationListener
protected void finalize()
finalize
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |