public interface AdapterRegistryMBean extends BaseComponentMBean
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
JMX_REGISTRY_TYPE
The type for the adapter registry.
|
static java.lang.String |
REGISTRY_PREFIX |
static java.lang.String |
STANDARD_REGISTRY_JMX_NAME
The Standard Name for the Adapter Registry "com.adaptris:type=Registry,id=AdapterRegistry"
|
Modifier and Type | Method and Description |
---|---|
void |
addAdapter(AdapterManagerMBean adapter)
Add an
AdapterManagerMBean instance to the registry. |
void |
addConfiguration(java.util.Properties p) |
javax.management.ObjectName |
createAdapter(java.lang.String xml)
Deprecated.
since 3.6.1 get it via
getBuilder(Properties) instead. |
javax.management.ObjectName |
createAdapter(URLString url)
Deprecated.
since 3.6.1 get it via
getBuilder(Properties) instead. |
javax.management.ObjectName |
createAdapterFromUrl(java.lang.String url)
Deprecated.
since 3.6.1
|
void |
destroyAdapter(AdapterManagerMBean adapter)
Close the underlying adapter and unregister from JMX.
|
void |
destroyAdapter(javax.management.ObjectName adapter)
Close the underlying adapter and unregister from JMX.
|
java.util.Set<javax.management.ObjectName> |
getAdapters()
Get all the adapters that have been registered.
|
javax.management.ObjectName |
getBuilder(javax.management.ObjectName p)
Get a reference to the
AdapterBuilderMBean instance that built the corresponding AdapterManagerMBean instance. |
AdapterBuilderMBean |
getBuilder(java.util.Properties p)
Get the
AdapterBuilderMBean associated with given Properties object. |
AdapterBuilderMBean |
getBuilderMBean(javax.management.ObjectName p)
Get a reference to the
AdapterBuilderMBean instance that built the corresponding AdapterManagerMBean instance. |
java.util.Set<javax.management.ObjectName> |
getBuilders()
Get All the builders.
|
java.lang.String |
getClassDefinition(java.lang.String className)
In JSON format return the full class description, including subclasses and annotation detail.
|
java.util.Properties |
getConfiguration()
Deprecated.
since 3.6.1 get it via
getBuilder(ObjectName) instead. |
URLString |
getConfigurationURL(javax.management.ObjectName adapterName)
Get the URL that was used to create the adapter associated with that ObjectName.
|
java.lang.String |
getConfigurationURLString(javax.management.ObjectName adapterName)
Get the URL that was used to create the adapter associated with that ObjectName.
|
java.lang.String |
getVersionControl()
Return the version control system that is currently in use based on
RuntimeVersionControl.getImplementationName()
|
void |
persist(java.lang.String data,
URLString url)
Persist some data the given URL.
|
void |
persistAdapter(AdapterManagerMBean adapter,
java.lang.String url)
Persist the adapter to the given URL.
|
void |
persistAdapter(AdapterManagerMBean adapter,
URLString url)
Persist the adapter to the given URL.
|
void |
persistAdapter(javax.management.ObjectName adapter,
java.lang.String url)
Persist the adapter to the given URL.
|
void |
persistAdapter(javax.management.ObjectName adapter,
URLString url)
Persist the adapter to the given URL.
|
void |
putConfigurationURL(javax.management.ObjectName adapterName,
java.lang.String url)
Register a URL against a given ObjectName.
|
void |
putConfigurationURL(javax.management.ObjectName adapterName,
URLString url)
Register a URL against a given ObjectName.
|
java.util.Set<javax.management.ObjectName> |
reloadFromConfig()
Recreate all adapters associated with this AdapterRegistry from their associated bootstrap file.
|
javax.management.ObjectName |
reloadFromConfig(javax.management.ObjectName obj)
Recreate the adapters associated with the specified objectname from their associated bootstrap file.
|
void |
reloadFromVersionControl()
Recreate all adapters associated with this AdapterRegistry from version control.
|
javax.management.ObjectName |
reloadFromVersionControl(javax.management.ObjectName obj)
Recreate the adapter associated with the specified objectname from their associated bootstrap file.
|
boolean |
removeConfigurationURL(javax.management.ObjectName adapterName)
Remove the URL that was used to create the adapter associated with the ObjectName.
|
void |
validateConfig(java.lang.String config)
Attempts to unmarshal the component within this target runtime unit.
|
createObjectName, registerMBean, unregisterMBean
static final java.lang.String JMX_REGISTRY_TYPE
static final java.lang.String REGISTRY_PREFIX
static final java.lang.String STANDARD_REGISTRY_JMX_NAME
java.util.Set<javax.management.ObjectName> getAdapters()
void persistAdapter(AdapterManagerMBean adapter, URLString url) throws java.io.IOException, CoreException
adapter
- the adapter Manager.url
- the url.java.io.IOException
CoreException
void persistAdapter(AdapterManagerMBean adapter, java.lang.String url) throws java.io.IOException, CoreException
adapter
- the adapter Manager.url
- the url.java.io.IOException
CoreException
void persistAdapter(javax.management.ObjectName adapter, URLString url) throws java.io.IOException, CoreException
adapter
- the AdapterManagerMBean
ObjectName.url
- the url.java.io.IOException
CoreException
void persistAdapter(javax.management.ObjectName adapter, java.lang.String url) throws java.io.IOException, CoreException
adapter
- the AdapterManagerMBean
ObjectName.url
- the url.java.io.IOException
CoreException
void persist(java.lang.String data, URLString url) throws java.io.IOException, CoreException
data
- the data.url
- the url.java.io.IOException
CoreException
@Deprecated javax.management.ObjectName createAdapter(URLString url) throws java.io.IOException, javax.management.MalformedObjectNameException, CoreException
getBuilder(Properties)
instead.
Create an adapter from the given URL; the license associated with this adapter is one that was derived from
bootstrap.properties
.
url
- the urlAdapterManagerMBean
java.io.IOException
- an error accessing the URL.CoreException
- an error creating the underlying adapter.javax.management.MalformedObjectNameException
- if there was a problem@Deprecated javax.management.ObjectName createAdapterFromUrl(java.lang.String url) throws java.io.IOException, javax.management.MalformedObjectNameException, CoreException
Create an adapter from the given URL; the license associated with this adapter is one that was derived from
bootstrap.properties
.
url
- the urlAdapterManagerMBean
java.io.IOException
- an error accessing the URL.CoreException
- an error creating the underlying adapter.javax.management.MalformedObjectNameException
- if there was a problemURLString getConfigurationURL(javax.management.ObjectName adapterName)
When attempting to persist an adapter instance, you can use this method to query for the URL
that was used to create the associated adapter. This will be the URL used to create the adapter
initially (i.e. the adapterConfigURL
that was resolved from
bootstrap.properties
) unless the adapter was created with
createAdapter(String xml) in the first instance (in which case, you need to
figure out where you want to persist the adapter in a different way).
Internally, the URLs are keyed against the ObjectName, which means that if create adapters that
have the same logical object name, then a URLString will be returned regardless of "how" you
created the adapter. So the code below will return http://my/url
if the two ObjectName
instances are considered the same.
{ @code ObjectName on = createAdapter(new URLString("http://my/url")); ObjectName on2 = createAdapter("<adapter>...</adapter>"); URLString url = getConfigurationURL(on2); }
adapterName
- object name representation for the associated AdapterManagerMBean
java.lang.String getConfigurationURLString(javax.management.ObjectName adapterName)
When attempting to persist an adapter instance, you can use this method to query for the URL that was used to create the
associated adapter. This will be the URL used to create the adapter initially (i.e. the adapterConfigURL
that was
resolved from bootstrap.properties
) unless the adapter was created with createAdapter(String xml) in the
first instance (in which case, you need to figure out where you want to persist the adapter in a different way).
Internally, the URLs are keyed against the ObjectName, which means that if create adapters that have the same logical object
name, then a URL will be returned regardless of "how" you created the adapter. So the code below will return
http://my/url
if the two ObjectName instances are considered the same.
ObjectName on = createAdapter(new URL("http://my/url"));
ObjectName on2 = createAdapter("<adapter>...</adapter>");
URL url = getConfigurationURL(on2);
adapterName
- object name representation for the associated AdapterManagerMBean
boolean removeConfigurationURL(javax.management.ObjectName adapterName)
Note that calling either destroyAdapter(AdapterManagerMBean) or destroyAdapter(ObjectName) will NOT
adapterName
- object name representation for the associated AdapterManagerMBean
void putConfigurationURL(javax.management.ObjectName adapterName, URLString url)
Where you have used createAdapter(String)
; there will not be an URL associated with the newly created adapter. Use
this to register a URL against the given ObjectName, which means that getConfigurationURL(ObjectName) will not
return a null object.
adapterName
- object name representation for the associated AdapterManagerMBean
url
- the URL to be stored against the objectnamevoid putConfigurationURL(javax.management.ObjectName adapterName, java.lang.String url) throws java.io.IOException
Where you have used createAdapter(String)
; there will not be an URL associated with the newly created adapter. Use
this to register a URL against the given ObjectName, which means that getConfigurationURL(ObjectName) will not
return a null object.
adapterName
- object name representation for the associated AdapterManagerMBean
url
- the URL to be stored against the objectnamejava.io.IOException
@Deprecated javax.management.ObjectName createAdapter(java.lang.String xml) throws java.io.IOException, javax.management.MalformedObjectNameException, CoreException
getBuilder(Properties)
instead.
Create an adapter from the given string; the license associated with this adapter is one that was derived from
bootstrap.properties
.
xml
- the string representation (generally XML).AdapterManagerMBean
java.io.IOException
- an error accessing the URL.CoreException
- an error creating the underlying adapter.javax.management.MalformedObjectNameException
- if there was a problem with the objectname.void addAdapter(AdapterManagerMBean adapter) throws javax.management.MalformedObjectNameException, CoreException
AdapterManagerMBean
instance to the registry.adapter
- the AdapterManagerMBean
instance.javax.management.MalformedObjectNameException
- if there was a problem with the objectnameCoreException
- if the objectname already exists in the registry.void destroyAdapter(AdapterManagerMBean adapter) throws CoreException, javax.management.MalformedObjectNameException
Note that this uses AdapterComponentMBean.requestClose()
which will block until the adapter is closed; if a timeout is
required, then make sure to use AdapterComponentMBean.requestClose(long)
and possibly
AdapterManagerMBean.forceClose()
before invoking this method.
adapter
- the AdapterManagerMBean
.CoreException
- an error accessing the underlying adapter.javax.management.MalformedObjectNameException
- if there was a problem with the objectname.void destroyAdapter(javax.management.ObjectName adapter) throws javax.management.MalformedObjectNameException, CoreException
Note that this uses AdapterComponentMBean.requestClose()
which will block until the adapter is closed; if a timeout is
required, then make sure to use AdapterComponentMBean.requestClose(long)
and possibly
AdapterManagerMBean.forceClose()
before invoking this method.
adapter
- the AdapterManagerMBean
.javax.management.MalformedObjectNameException
- if there was a problem with the objectname.CoreException
- an error accessing the underlying adapter.destroyAdapter(AdapterManagerMBean)
@Deprecated java.util.Properties getConfiguration()
getBuilder(ObjectName)
instead.BootstrapProperties
instance that was used to create this registry.java.lang.String getVersionControl()
void reloadFromVersionControl() throws javax.management.MalformedObjectNameException, CoreException, java.net.MalformedURLException, java.io.IOException
Note that the adapters will not be started as part of this process; this needs to be done separately.
javax.management.MalformedObjectNameException
- if there was a problem with any objectname.CoreException
- an error creating the underlying adapter(s).java.io.IOException
- if there was a with reading the URL where the adapter is hosted.java.net.MalformedURLException
- if there was a problem with the URL found from config.java.util.Set<javax.management.ObjectName> reloadFromConfig() throws javax.management.MalformedObjectNameException, CoreException, java.net.MalformedURLException, java.io.IOException
Note that the adapters will not be started as part of this process; this needs to be done separately.
AdapterManagerMBean
instances created.javax.management.MalformedObjectNameException
- if there was a problem with any objectname.CoreException
- an error creating the underlying adapter(s).java.io.IOException
- if there was a with reading the URL where the adapter is hosted.java.net.MalformedURLException
- if there was a problem with the URL found from config.void validateConfig(java.lang.String config) throws CoreException
This will verify that the component that was configured can be unmarshalled within the target runtime system. It is largely
similar to the createAdapter(String)
method, however it does not try to register a new AdapterManagerMBean
as
part of the operation.
config
- the String representation of a component.CoreException
- if there was an exception unmarshalling.createAdapter(String)
java.lang.String getClassDefinition(java.lang.String className) throws CoreException
className
- - fully qualifiedCoreException
javax.management.ObjectName reloadFromConfig(javax.management.ObjectName obj) throws javax.management.MalformedObjectNameException, CoreException, java.io.IOException, java.net.MalformedURLException
Note that the adapter will not be started as part of this process; this needs to be done separately.
obj
- the ObjectName to reload from config.AdapterManagerMBean
instances created.javax.management.MalformedObjectNameException
- if there was a problem with any objectname.CoreException
- an error creating the underlying adapter(s).java.io.IOException
- if there was a with reading the URL where the adapter is hosted.java.net.MalformedURLException
- if there was a problem with the URL found from config.javax.management.ObjectName reloadFromVersionControl(javax.management.ObjectName obj) throws javax.management.MalformedObjectNameException, CoreException, java.io.IOException, java.net.MalformedURLException
Note that the adapter will not be started as part of this process; this needs to be done separately.
obj
- the ObjectName to restart.AdapterManagerMBean
instances created.javax.management.MalformedObjectNameException
- if there was a problem with any objectname.CoreException
- an error creating the underlying adapter(s).java.io.IOException
- if there was a with reading the URL where the adapter is hosted.java.net.MalformedURLException
- if there was a problem with the URL found from config.void addConfiguration(java.util.Properties p) throws javax.management.MalformedObjectNameException, CoreException
javax.management.MalformedObjectNameException
CoreException
javax.management.ObjectName getBuilder(javax.management.ObjectName p) throws javax.management.InstanceNotFoundException
AdapterBuilderMBean
instance that built the corresponding AdapterManagerMBean
instance.p
- a reference to the AdapterManagerMBean
AdapterBuilderMBean
javax.management.InstanceNotFoundException
- if there was no associated builder.AdapterBuilderMBean getBuilderMBean(javax.management.ObjectName p) throws javax.management.InstanceNotFoundException
AdapterBuilderMBean
instance that built the corresponding AdapterManagerMBean
instance.p
- a reference to the AdapterManagerMBean
AdapterBuilderMBean
javax.management.InstanceNotFoundException
- if there was no associated builder.AdapterBuilderMBean getBuilder(java.util.Properties p) throws javax.management.InstanceNotFoundException
AdapterBuilderMBean
associated with given Properties
object.javax.management.InstanceNotFoundException
java.util.Set<javax.management.ObjectName> getBuilders()