|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.norther.tammi.core.base.Adaptee org.norther.tammi.core.base.DefaultContainer<ObjectFactory<?>> org.norther.tammi.core.base.DefaultFactory
public class DefaultFactory
A default implementation of Factory. This implementation forwards complicated instantiations to class specific factories, but can itself instantiate any available classes with one or more public constructors.
Field Summary |
---|
Fields inherited from class org.norther.tammi.core.base.Adaptee |
---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
Constructor Summary | |
---|---|
DefaultFactory()
Constructs a new factory. |
Method Summary | |
---|---|
void |
clear()
Clears all MBeans from this registry. |
ObjectFactory<?> |
get(String className)
Gets the referent of the MBean in this registry. |
Object |
getInstance(String className)
Gets an instance of a named class. |
Object |
getInstance(String className,
Object[] params,
String[] signature)
Gets an instance of a named class. |
Object |
getInstance(String className,
ObjectName loader)
Gets an instance of a named class using a specified class loader. |
Object |
getInstance(String className,
ObjectName loader,
Object[] params,
String[] signature)
Gets an instance of a named class using a specified class loader. |
MBeanReference<ObjectFactory<?>> |
getMBean(String className)
Gets a reference to the MBean in this registry. |
protected MBeanHandle<ObjectFactory<?>> |
getMBeanHandle(String key)
Gets a reference to a mapped MBean. |
ObjectName |
getObjectName(String className)
Gets the object name of the MBean in this registry, which is also registered in the MBean server. |
Set<ObjectName> |
getObjectNames(String className)
Gets a set of object names registered in the MBean server with names matching the query pattern of the MBean in this registry. |
ObjectName |
getQueryPattern(String className)
Gets the query pattern, with which the MBean is registered in this registry. |
boolean |
isLoaderSupported(String className)
Checks if specified class loaders are supported for a named class. |
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 |
remove(String className)
Removes an MBean from this registry. |
void |
setQueryPattern(String className,
ObjectName name)
Sets the object name of a registry MBean. |
void |
setQueryPattern(String className,
String ifname,
ObjectName name)
Sets the interface and object name of a registry MBean. |
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. |
Methods inherited from class org.norther.tammi.core.base.DefaultContainer |
---|
containsKey, getContainerKey, getContainerKey, getContainerKey, getMBeanHandles, getMBeanInterface, getMBeanInterface, registryKeySet, registryKeySet, registryKeySet, registryKeySet, registryMap, registrySize, setMBeanInterface |
Methods inherited from class org.norther.tammi.core.base.Adaptee |
---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.norther.tammi.core.base.Container |
---|
containsKey, getContainerKey, getContainerKey, getContainerKey, getMBeanInterface, getMBeanInterface, registryKeySet, registryKeySet, registryKeySet, registryKeySet, registryMap, registrySize, setMBeanInterface |
Constructor Detail |
---|
public DefaultFactory()
Method Detail |
---|
public void postmanaged()
Manageable
postmanaged
in interface Manageable
postmanaged
in class Adaptee
public void unmanaged() throws Exception
Manageable
unmanaged
in interface Manageable
unmanaged
in class Adaptee
Exception
- if the adaptee refused to be unmanaged.public Object getInstance(String className) throws ConstructionException
ObjectFactory
getInstance
in interface ObjectFactory<Object>
className
- the name of the class.
ConstructionException
- if construction fails.public Object getInstance(String className, ObjectName loader) throws ConstructionException
ObjectFactory
Class loaders are supported only if the isLoaderSupported method returns true. Otherwise the loader parameter is ignored.
getInstance
in interface ObjectFactory<Object>
className
- the name of the class.loader
- the class loader.
ConstructionException
- if construction fails.public Object getInstance(String className, Object[] params, String[] signature) throws ConstructionException
ObjectFactory
getInstance
in interface ObjectFactory<Object>
className
- the name of the class.params
- an array containing the parameters of the constructor.signature
- an array containing the signature of the constructor.
ConstructionException
- if construction fails.public Object getInstance(String className, ObjectName loader, Object[] params, String[] signature) throws ConstructionException
ObjectFactory
Class loaders are supported only if the isLoaderSupported method returns true. Otherwise the loader parameter is ignored.
getInstance
in interface ObjectFactory<Object>
className
- the name of the class.loader
- the class loader.params
- an array containing the parameters of the constructor.signature
- an array containing the signature of the constructor.
ConstructionException
- if construction fails.public boolean isLoaderSupported(String className)
ObjectFactory
isLoaderSupported
in interface ObjectFactory<Object>
className
- the name of the class.
public ObjectFactory<?> get(String className)
Container
get
in interface Container<ObjectFactory<?>>
get
in class DefaultContainer<ObjectFactory<?>>
className
- the registry key.
public MBeanReference<ObjectFactory<?>> getMBean(String className)
Container
getMBean
in interface Container<ObjectFactory<?>>
getMBean
in class DefaultContainer<ObjectFactory<?>>
className
- the registry key.
public ObjectName getQueryPattern(String className)
Container
getQueryPattern
in interface Container<ObjectFactory<?>>
getQueryPattern
in class DefaultContainer<ObjectFactory<?>>
className
- the registry key.
public void setQueryPattern(String className, ObjectName name)
Container
setQueryPattern
in interface Container<ObjectFactory<?>>
setQueryPattern
in class DefaultContainer<ObjectFactory<?>>
className
- the registry key.name
- the object name or query pattern.public void setQueryPattern(String className, String ifname, ObjectName name)
Container
setQueryPattern
in interface Container<ObjectFactory<?>>
setQueryPattern
in class DefaultContainer<ObjectFactory<?>>
className
- the registry key.ifname
- the class or interface name.name
- the object name or query pattern.public ObjectName getObjectName(String className)
Container
getObjectName
in interface Container<ObjectFactory<?>>
getObjectName
in class DefaultContainer<ObjectFactory<?>>
className
- the registry key.
public Set<ObjectName> getObjectNames(String className)
Container
getObjectNames
in interface Container<ObjectFactory<?>>
getObjectNames
in class DefaultContainer<ObjectFactory<?>>
className
- the registry key.
public void remove(String className)
Container
remove
in interface Container<ObjectFactory<?>>
remove
in class DefaultContainer<ObjectFactory<?>>
className
- the registry key.public void clear()
Container
clear
in interface Container<ObjectFactory<?>>
clear
in class DefaultContainer<ObjectFactory<?>>
protected MBeanHandle<ObjectFactory<?>> getMBeanHandle(String key)
DefaultContainer
Note that the reference is meant for internal use only.
getMBeanHandle
in class DefaultContainer<ObjectFactory<?>>
key
- the key to the MBean.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |