|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.base.Adaptee
org.norther.tammi.core.base.DefaultContainer
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 |
| Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate |
|---|
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE |
| Constructor Summary | |
|---|---|
DefaultFactory()
Constructs a new factory. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears all MBeans from this registry. |
Object |
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 |
getMBean(String className)
Gets a reference to the MBean in this registry. |
protected MBeanHandle |
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. |
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 key)
Removes an MBean from this registry. |
void |
setQueryPattern(String key,
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, getObjectNames, registryKeySet, registryKeySet, registryKeySet, registryKeySet, registryMap, registrySize, setMBeanInterface, setQueryPattern |
| 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, getObjectNames, registryKeySet, registryKeySet, registryKeySet, registryKeySet, registryMap, registrySize, setMBeanInterface, setQueryPattern |
| Constructor Detail |
|---|
public DefaultFactory()
| Method Detail |
|---|
public void postmanaged()
Manageable
postmanaged in interface Manageablepostmanaged in class Adaptee
public void unmanaged()
throws Exception
Manageable
unmanaged in interface Manageableunmanaged in class AdapteeException - if the adaptee refused to be unmanaged.
public Object getInstance(String className)
throws ConstructionException
ObjectFactory
getInstance in interface ObjectFactoryclassName - the name of the class.
ConstructionException - if construction fails.
public Object getInstance(String className,
ObjectName loader)
throws ConstructionException
ObjectFactoryClass loaders are supported only if the isLoaderSupported method returns true. Otherwise the loader parameter is ignored.
getInstance in interface ObjectFactoryclassName - 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 ObjectFactoryclassName - 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
ObjectFactoryClass loaders are supported only if the isLoaderSupported method returns true. Otherwise the loader parameter is ignored.
getInstance in interface ObjectFactoryclassName - 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 ObjectFactoryclassName - the name of the class.
public Object get(String className)
Container
get in interface Containerget in class DefaultContainerclassName - the registry key.
public MBeanReference getMBean(String className)
Container
getMBean in interface ContainergetMBean in class DefaultContainerclassName - the registry key.
public ObjectName getQueryPattern(String className)
Container
getQueryPattern in interface ContainergetQueryPattern in class DefaultContainerclassName - the registry key.
public void setQueryPattern(String key,
String ifname,
ObjectName name)
Container
setQueryPattern in interface ContainersetQueryPattern in class DefaultContainerkey - 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 ContainergetObjectName in class DefaultContainerclassName - the registry key.
public void remove(String key)
Container
remove in interface Containerremove in class DefaultContainerkey - the registry key.public void clear()
Container
clear in interface Containerclear in class DefaultContainerprotected MBeanHandle getMBeanHandle(String key)
DefaultContainerNote that the reference is meant for internal use only.
getMBeanHandle in class DefaultContainerkey - the key to the MBean.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||