org.norther.tammi.core.base
Class Adaptee

java.lang.Object
  extended by org.norther.tammi.core.base.Adaptee
All Implemented Interfaces:
Serializable, NotificationBroadcaster, NotificationEmitter, Manageable, MBeanDelegate
Direct Known Subclasses:
AbstractExecutor, AbstractRepositoryParser, DefaultAccessController, DefaultCacheClient, DefaultConfigurable, DefaultConfigurator, DefaultConnector, DefaultContainer, DefaultContentTypeMap, DefaultDomain, DefaultExecutable, DefaultFilter, DefaultKeyStoreLoader, DefaultLibrary, DefaultMailbot, DefaultMediaProvider, DefaultObjectConverter, DefaultObjectFactory, DefaultPathFinder, DefaultPool, DefaultRegistry, DefaultRepositoryClient, DefaultResourceFinder, DefaultResourceMap, DefaultSchedulable, DefaultScheduler, DefaultStartup, DefaultStartupContext, DefaultTaskLoader

public class Adaptee
extends Object
implements Manageable, MBeanDelegate, Serializable

A manageable adaptee for non-referable MBeans.

Version:
$Id: Adaptee.java,v 1.22 2009/09/28 15:08:42 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
static String ADAPTEE_NOTIF_DESCRIPTION
          The notification description.
static ModelMBeanNotificationInfo[] ADAPTEE_NOTIFICATIONS
          Adaptee notifications.
 
Constructor Summary
Adaptee()
          Constructs a new adaptee.
 
Method Summary
 void addAdaptee(Manageable adaptee)
          Adds a nested adaptee.
 void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
           
 AttributeSupport getAttributeSupport()
          Gets the attribute support.
 Broker getBroker()
          Gets the referent of the broker MBean.
 String getCanonicalName()
          Gets the canonical name.
 Domain getDomain()
          Gets the referent of the domain MBean.
 Factory getFactory()
          Gets the referent of the factory MBean.
 Loader getLoader()
          Gets the referent of the loader MBean.
 Log getLog()
          Gets an anonymous log.
 Log getLog(Object object)
          Gets an object specific log.
 MBeanReference<?> getMBean()
          Gets a reference to the adapter MBean.
 MBeanServer getMBeanServer()
          Gets the MBean server.
 MBeanNotificationInfo[] getNotificationInfo()
           
 ObjectName getObjectName()
          Gets the object name.
 long getRegistrationTime()
          Gets the registration time.
 long getSequenceNumber()
          Gets the notification sequence number.
 boolean hasListeners()
          Checks whether there are registered notification listeners.
 boolean isRegistered()
          Checks whether registered.
 void postmanaged()
          This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time.
 void premanaged(MBeanDelegate adapter)
          This method is called when the implementing adaptee is trying to be managed either during pre-registration of the corresponding adapter MBean or just before it is explicitly added to the adapter MBean during run-time.
 void removeNotificationListener(NotificationListener listener)
           
 void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
           
 void sendNotification(Notification notif)
          Sends the specified notification.
 void sendNotification(String message)
          Sends a generic notification.
 void sendNotification(String message, Object data)
          Sends a generic notification with data.
 void sendNotification(String message, String name, String type, Object... values)
          Sends a modification notification.
 void unmanaged()
          This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time.
 void unregister()
          Unregisters this MBean if it is still registered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADAPTEE_NOTIF_DESCRIPTION

public static final String ADAPTEE_NOTIF_DESCRIPTION
The notification description.

See Also:
Constant Field Values

ADAPTEE_NOTIFICATIONS

public static final ModelMBeanNotificationInfo[] ADAPTEE_NOTIFICATIONS
Adaptee notifications.

Constructor Detail

Adaptee

public Adaptee()
Constructs a new adaptee.

Method Detail

premanaged

public void premanaged(MBeanDelegate adapter)
                throws Exception
Description copied from interface: Manageable
This method is called when the implementing adaptee is trying to be managed either during pre-registration of the corresponding adapter MBean or just before it is explicitly added to the adapter MBean during run-time.

Specified by:
premanaged in interface Manageable
Parameters:
adapter - the managing adapter.
Throws:
Exception - if the adaptee refused to be managed.

postmanaged

public void postmanaged()
Description copied from interface: Manageable
This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time.

Specified by:
postmanaged in interface Manageable

unmanaged

public void unmanaged()
               throws Exception
Description copied from interface: Manageable
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time.

Specified by:
unmanaged in interface Manageable
Throws:
Exception - if the adaptee refused to be unmanaged.

getMBean

public MBeanReference<?> getMBean()
Description copied from interface: MBeanDelegate
Gets a reference to the adapter MBean.

Specified by:
getMBean in interface MBeanDelegate
Returns:
a reference to the adapter MBean.

getLoader

public Loader getLoader()
Description copied from interface: MBeanDelegate
Gets the referent of the loader MBean.

Specified by:
getLoader in interface MBeanDelegate
Returns:
the loader MBean referent.

getDomain

public Domain getDomain()
Description copied from interface: MBeanDelegate
Gets the referent of the domain MBean.

Specified by:
getDomain in interface MBeanDelegate
Returns:
the domain MBean referent.

getBroker

public Broker getBroker()
Description copied from interface: MBeanDelegate
Gets the referent of the broker MBean.

Specified by:
getBroker in interface MBeanDelegate
Returns:
the broker MBean referent.

getFactory

public Factory getFactory()
Description copied from interface: MBeanDelegate
Gets the referent of the factory MBean.

Specified by:
getFactory in interface MBeanDelegate
Returns:
the factory MBean referent.

getLog

public Log getLog(Object object)
Description copied from interface: MBeanDelegate
Gets an object specific log.

Specified by:
getLog in interface MBeanDelegate
Parameters:
object - the object.
Returns:
an object specific log.

getLog

public Log getLog()
Description copied from interface: MBeanDelegate
Gets an anonymous log.

Specified by:
getLog in interface MBeanDelegate
Returns:
an anonymous log.

getRegistrationTime

public long getRegistrationTime()
Description copied from interface: MBeanDelegate
Gets the registration time.

Specified by:
getRegistrationTime in interface MBeanDelegate
Returns:
the registration time in msecs.

unregister

public void unregister()
Description copied from interface: MBeanDelegate
Unregisters this MBean if it is still registered.

Specified by:
unregister in interface MBeanDelegate

getSequenceNumber

public long getSequenceNumber()
Description copied from interface: MBeanDelegate
Gets the notification sequence number.

Specified by:
getSequenceNumber in interface MBeanDelegate
Returns:
the sequence number.

sendNotification

public void sendNotification(Notification notif)
Description copied from interface: MBeanDelegate
Sends the specified notification.

Specified by:
sendNotification in interface MBeanDelegate
Parameters:
notif - the notification to send.

sendNotification

public void sendNotification(String message)
Description copied from interface: MBeanDelegate
Sends a generic notification.

Specified by:
sendNotification in interface MBeanDelegate
Parameters:
message - the notification message.

sendNotification

public void sendNotification(String message,
                             Object data)
Description copied from interface: MBeanDelegate
Sends a generic notification with data.

Specified by:
sendNotification in interface MBeanDelegate
Parameters:
message - the notification message.
data - a user data object of any type.

sendNotification

public void sendNotification(String message,
                             String name,
                             String type,
                             Object... values)
Description copied from interface: MBeanDelegate
Sends a modification notification.

Not that changed attribute values need not to be passed to the notification. Null type is replaced with java.lang.Object.

Specified by:
sendNotification in interface MBeanDelegate
Parameters:
message - the notification message.
name - the attribute name.
type - the attribute type.
values - the old and new value of the attribute.

hasListeners

public boolean hasListeners()
Description copied from interface: MBeanDelegate
Checks whether there are registered notification listeners.

Specified by:
hasListeners in interface MBeanDelegate
Returns:
true if notications can be send, otherwise false.

addNotificationListener

public void addNotificationListener(NotificationListener listener,
                                    NotificationFilter filter,
                                    Object handback)
Specified by:
addNotificationListener in interface NotificationBroadcaster

removeNotificationListener

public void removeNotificationListener(NotificationListener listener,
                                       NotificationFilter filter,
                                       Object handback)
                                throws ListenerNotFoundException
Specified by:
removeNotificationListener in interface NotificationEmitter
Throws:
ListenerNotFoundException

removeNotificationListener

public void removeNotificationListener(NotificationListener listener)
                                throws ListenerNotFoundException
Specified by:
removeNotificationListener in interface NotificationBroadcaster
Throws:
ListenerNotFoundException

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
Specified by:
getNotificationInfo in interface NotificationBroadcaster

getObjectName

public ObjectName getObjectName()
Gets the object name.

Returns:
the object name or null.

isRegistered

public boolean isRegistered()
Checks whether registered.

Returns:
true if registered, false otherwise.

getMBeanServer

public MBeanServer getMBeanServer()
Gets the MBean server.

Returns:
the MBean server or null.

getCanonicalName

public String getCanonicalName()
Gets the canonical name.

Returns:
the canonical name or null.

getAttributeSupport

public AttributeSupport getAttributeSupport()
Gets the attribute support.

Returns:
the attribute support.

addAdaptee

public void addAdaptee(Manageable adaptee)
Adds a nested adaptee.

Parameters:
adaptee - the nested adaptee.


Copyright © 2004 The Norther Organization. All rights reserved.