|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.wsspi.runtime.component.WsComponentImpl
public class WsComponentImpl
WsComponentImpl provides a default implementation of the WsComponent interface. Lifecycle methods are no-ops. Additionally, various convenience methods are provided.
Field Summary | |
---|---|
protected java.lang.String |
name
Deprecated. This field will be private in a future release. It is protected for legacy reasons. |
protected java.lang.String |
state
Deprecated. This field will be private in a future release. It is protected for legacy reasons. |
Fields inherited from interface com.ibm.wsspi.runtime.component.WsComponent |
---|
DESTROYED, DESTROYING, ERROR, INITIALIZED, INITIALIZING, STARTED, STARTING, STATE, STOPPED, STOPPING |
Constructor Summary | |
---|---|
protected |
WsComponentImpl()
The default constructor for a WsComponentImpl. |
Method Summary | |
---|---|
static void |
_setStartupThreadPool(com.ibm.ws.util.ThreadPool threadPool)
NOTE: This method is not part of the official SPI and should not be invoked by general code. |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener propertyChangeListener)
Adds a property change listener to this component. |
protected void |
deregisterMBean(java.lang.Object obj)
Deregisters the MBean associated with the given object. |
protected void |
deregisterMBean(java.lang.String id)
Deregisters the MBean associated with the given ID. |
protected void |
deregisterMBeanViaQuery(java.lang.String query)
Deregisters all MBeans identified by the given query string. |
void |
destroy()
A lifecycle event. |
protected java.lang.String |
expandVariable(java.lang.String string)
Expands all variables in the given string per the variable map service established for this runtime context. |
protected void |
firePropertyChange(java.beans.PropertyChangeEvent evt)
Broadcast a PropertyChangeEvent to all listeners. |
protected java.lang.String |
getConfigId(java.lang.Object object)
Gets the administrative configuration ID associated with the given object. |
java.lang.String |
getName()
Returns the name of this component. |
protected java.beans.PropertyChangeSupport |
getPropertyChangeSupport()
Provides access to the PropertyChangeSupport object. |
java.lang.String |
getState()
Returns the current state of the component. |
void |
inhibitAsynchBehavior()
NOTE: This method is not part of the official SPI and should not be invoked by general code. |
void |
initialize(java.lang.Object config)
A lifecycle event invoked when the component is being initialized. |
protected void |
join()
Blocks until all (accountable) tasks dispatched by runAsynchronousInitializer have completed. |
protected java.util.Set |
lookupMBeans(java.lang.String name)
Looks up MBeans via the given query string. |
protected void |
registerMBean(java.lang.String type,
com.ibm.websphere.management.RuntimeCollaborator collab,
java.lang.String name,
java.lang.String id,
java.util.Properties props)
Registers an MBean. |
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener propertyChangeListener)
Removes a property change listener from this component. |
protected void |
runAsynchronousInitializer(AsynchronousInitializer initializer)
Equivalent to runAsynchronousInitializer(initializer,true) . |
protected void |
runAsynchronousInitializer(AsynchronousInitializer initializer,
boolean joinFlag)
Requests that the initializer be run on another thread. |
static void |
setGlobalAsynchBehaviorInhibited(boolean b)
NOTE: This method is not part of the official SPI and should not be invoked by general code. |
protected void |
setName(java.lang.String name)
Sets the name of this component. |
protected void |
setState(java.lang.String newState)
Updates the state of the component. |
void |
start()
A lifecycle event indicating that the component should start. |
void |
stop()
A lifecycle event indicating that the component should stop. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String name
protected java.lang.String state
Constructor Detail |
---|
protected WsComponentImpl()
Method Detail |
---|
public void initialize(java.lang.Object config) throws ComponentDisabledException, ConfigurationWarning, ConfigurationError
WsComponent
initialize
in interface WsComponent
config
- The configuration data for the component. The value may
be null or some other object if no configuration data is present. Note that
this argument may be removed.
ComponentDisabledException
- Thrown if the component considers itself to
be disabled. No further lifecycle methods will be called by the framework.
ConfigurationWarning
- Thrown if the component has encountered some
non-fatal configuration problem. Server startup will generally continue.
ConfigurationError
- The component has severe configuration
problem and cannot allow the server startup to proceed. Note that this
exception will halt server startup.WsComponent.initialize(Object)
public void destroy()
WsComponent
destroy
in interface WsComponent
WsComponent.destroy()
public void start() throws RuntimeError, RuntimeWarning
WsComponent
start
in interface WsComponent
RuntimeError
RuntimeWarning
WsComponent.start()
public void stop()
WsComponent
stop
in interface WsComponent
WsComponent.stop()
public static void _setStartupThreadPool(com.ibm.ws.util.ThreadPool threadPool)
public static void setGlobalAsynchBehaviorInhibited(boolean b)
public void inhibitAsynchBehavior()
protected final void runAsynchronousInitializer(AsynchronousInitializer initializer) throws WsRuntimeFwException
runAsynchronousInitializer(initializer,true)
.
WsRuntimeFwException
runAsynchronousInitializer(AsynchronousInitializer, boolean)
protected final void runAsynchronousInitializer(AsynchronousInitializer initializer, boolean joinFlag) throws WsRuntimeFwException
AsynchronousInitializer
- initializer is the work to be done.boolean
- joinFlag indicates whether the work is to be accounted for in a join call.
WsRuntimeFwException
join()
protected final void join() throws ConfigurationWarning, ConfigurationError, ComponentDisabledException, RuntimeWarning, RuntimeError
ConfigurationWarning
ConfigurationError
ComponentDisabledException
RuntimeWarning
RuntimeError
runAsynchronousInitializer(AsynchronousInitializer, boolean)
public java.lang.String getName()
getName
in interface WsComponent
protected void setName(java.lang.String name)
name
- public java.lang.String getState()
getState
in interface WsComponent
protected void setState(java.lang.String newState) throws RuntimeError, RuntimeWarning, ConfigurationError, ConfigurationWarning
newState
-
RuntimeError
RuntimeWarning
ConfigurationError
ConfigurationWarning
protected java.beans.PropertyChangeSupport getPropertyChangeSupport()
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener propertyChangeListener)
propertyName
- propertyChangeListener
- PropertyChangeListener
public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener propertyChangeListener)
propertyName
- propertyChangeListener
- PropertyChangeListener
protected void firePropertyChange(java.beans.PropertyChangeEvent evt)
protected java.lang.String expandVariable(java.lang.String string) throws java.lang.IllegalArgumentException
string
- The string to be expanded.
java.lang.IllegalArgumentException
com.ibm.ws.util.service.VariableMap#expand(java.lang.String)
protected java.lang.String getConfigId(java.lang.Object object)
AdminServiceFactory.getMBeanFactory().getConfigId(obj)
protected void registerMBean(java.lang.String type, com.ibm.websphere.management.RuntimeCollaborator collab, java.lang.String name, java.lang.String id, java.util.Properties props)
AdminServiceFactory.getMBeanFactory.activateMBean(type,collab,id,null,props);
type
- Specifies the MBean type.collab
- Specifies the collaborator object to be used as the MBean implementation.name
- The name of the MBean.id
- The ID of the MBeanprops
-
protected void deregisterMBean(java.lang.String id)
id
- The ID of the MBean being deregistered.protected void deregisterMBean(java.lang.Object obj)
deregisterMBean(getConfigId(obj))
protected void deregisterMBeanViaQuery(java.lang.String query)
protected java.util.Set lookupMBeans(java.lang.String name)
Example:
lookupMBeans("WebSphere:j2eeType=J2EEServer,*");
name
- The query string.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |