|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport
org.jboss.system.ServiceController
public class ServiceController
This is the main Service Controller. A controller can deploy a service to a jboss.system It installs by delegating, it configures by delegating
This class has been rewritten to delegate to the microcontainer's generic controller. Like the original ServiceController, all state transitions must be handled manually, e.g. driven by the deployer invoking create, start, stop, etc. That is with one exception; we register ourselves an automatic context.
Service
Field Summary | |
---|---|
static ObjectName |
DEFAULT_LOADER_REPOSITORY
The ObjectName of the default loader repository |
protected Map<ObjectName,ServiceControllerContext> |
installed
The contexts |
protected CopyOnWriteArrayList<ServiceControllerContext> |
installedOrder
The contexts in installation order |
static String |
JBOSS_INTERNAL_LIFECYCLE
The operation name for lifecycle |
static String[] |
JBOSS_INTERNAL_LIFECYCLE_SIG
The signature for lifecycle operations |
protected org.jboss.kernel.Kernel |
kernel
The kernel |
protected MBeanServer |
server
A callback to the JMX MBeanServer |
Fields inherited from interface org.jboss.system.ServiceControllerMBean |
---|
OBJECT_NAME |
Constructor Summary | |
---|---|
ServiceController()
|
Method Summary | |
---|---|
void |
create(ObjectName serviceName)
Create a service |
void |
create(ObjectName serviceName,
Collection<ObjectName> depends)
Create a service with given dependencies |
void |
destroy(ObjectName serviceName)
Destroy the indicated service |
org.jboss.kernel.Kernel |
getKernel()
Get the kernel. |
MBeanServer |
getMBeanServer()
Get the MBeanServer |
ServiceContext |
getServiceContext(ObjectName serviceName)
Lookup the ServiceContext for the given serviceName |
protected Throwable |
getStackTrace()
Get exception that will expose stacktrace. |
List<ObjectName> |
install(Element config,
ObjectName loaderName)
Deploy the beans; deploy means "instantiate and configure" so the MBean is created in the MBeanServer. |
List<ObjectName> |
install(List<ServiceMetaData> metaDatas,
ObjectName loaderName)
|
void |
install(ObjectName name,
Object object)
Install an MBean without any meta data |
ObjectName |
install(ServiceMetaData metaData,
ObjectName loaderName)
|
String |
listConfiguration(ObjectName[] objectNames)
Gets the Configuration attribute of the ServiceController object |
List<ServiceContext> |
listDeployed()
Lists the ServiceContexts of deployed mbeans |
List<ObjectName> |
listDeployedNames()
lists ObjectNames of deployed mbeans deployed through serviceController. |
List<ServiceContext> |
listIncompletelyDeployed()
The listIncompletelyDeployed method returns the
service contexts for the mbeans whose status is not CREATED,
RUNNING, STOPPED or DESTROYED. |
void |
postDeregister()
|
void |
postRegister(Boolean registrationDone)
|
void |
preDeregister()
|
ObjectName |
preRegister(MBeanServer server,
ObjectName name)
|
void |
register(ObjectName serviceName)
Register the mbean against the microkernel with no dependencies. |
void |
register(ObjectName serviceName,
Collection<ObjectName> depends)
Register the mbean against the microkernel with dependencies. |
void |
register(ObjectName serviceName,
Collection<ObjectName> depends,
boolean includeLifecycle)
Register the mbean against the microkernel with dependencies. |
void |
register(ObjectName serviceName,
Collection<ObjectName> depends,
boolean includeLifecycle,
Object target)
Register the mbean against the microkernel with dependencies. |
void |
remove(ObjectName objectName)
This MBean is going bye bye |
void |
restart(ObjectName serviceName)
Stops and restarts the indicated service |
static Exception |
rethrow(String context,
Throwable t)
Rethrow an error as an exception |
void |
sendControllerNotification(String type,
ObjectName serviceName)
Sends outs controller notifications about service lifecycle events |
void |
setKernel(org.jboss.kernel.Kernel kernel)
Set the kernel. |
void |
setMBeanServer(MBeanServer server)
Set the server. |
void |
shutdown()
Describe shutdown method here. |
void |
start(ObjectName serviceName)
Starts the indicated service |
void |
stop(ObjectName serviceName)
Stop the indicated service |
void |
validateDeploymentState(DeploymentInfo di,
DeploymentState state)
Go through the mbeans of the DeploymentInfo and validate that they are in a state at least equal to that of the argument state |
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport |
---|
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ObjectName DEFAULT_LOADER_REPOSITORY
public static final String JBOSS_INTERNAL_LIFECYCLE
public static final String[] JBOSS_INTERNAL_LIFECYCLE_SIG
protected org.jboss.kernel.Kernel kernel
protected MBeanServer server
protected Map<ObjectName,ServiceControllerContext> installed
protected CopyOnWriteArrayList<ServiceControllerContext> installedOrder
Constructor Detail |
---|
public ServiceController()
Method Detail |
---|
public static Exception rethrow(String context, Throwable t) throws Exception
context
- the contextt
- the original throwable
Exception
- alwaysprotected Throwable getStackTrace()
public MBeanServer getMBeanServer()
public void setMBeanServer(MBeanServer server)
server
- the server.public org.jboss.kernel.Kernel getKernel()
public void setKernel(org.jboss.kernel.Kernel kernel)
kernel
- the kernel.public List<ServiceContext> listDeployed()
ServiceControllerMBean
listDeployed
in interface ServiceControllerMBean
public List<ServiceContext> listIncompletelyDeployed()
ServiceControllerMBean
listIncompletelyDeployed
method returns the
service contexts for the mbeans whose status is not CREATED,
RUNNING, STOPPED or DESTROYED. An MBean that has reached one
of the above states has its dependencies resolved.
listIncompletelyDeployed
in interface ServiceControllerMBean
public List<ObjectName> listDeployedNames()
ServiceControllerMBean
listDeployedNames
in interface ServiceControllerMBean
public String listConfiguration(ObjectName[] objectNames) throws Exception
ServiceControllerMBean
listConfiguration
in interface ServiceControllerMBean
objectNames
- Description of Parameter
Exception
- Description of Exceptionpublic void validateDeploymentState(DeploymentInfo di, DeploymentState state)
ServiceControllerMBean
validateDeploymentState
in interface ServiceControllerMBean
di
- the deployment infostate
- the deployment statepublic List<ObjectName> install(List<ServiceMetaData> metaDatas, ObjectName loaderName) throws Exception
Exception
public ObjectName install(ServiceMetaData metaData, ObjectName loaderName) throws Exception
Exception
public List<ObjectName> install(Element config, ObjectName loaderName) throws Exception
ServiceControllerMBean
install
in interface ServiceControllerMBean
Exception
- for any errorpublic void install(ObjectName name, Object object) throws Exception
name
- the object nameobject
- the mbean object
Exception
- for any errorpublic void register(ObjectName serviceName) throws Exception
ServiceControllerMBean
register
in interface ServiceControllerMBean
serviceName
- the object name
Exception
- for any errorServiceControllerMBean.register(ObjectName, java.util.Collection)
public void register(ObjectName serviceName, Collection<ObjectName> depends) throws Exception
ServiceControllerMBean
register
in interface ServiceControllerMBean
serviceName
- the object namedepends
- the dependencies
Exception
- for any errorpublic void register(ObjectName serviceName, Collection<ObjectName> depends, boolean includeLifecycle) throws Exception
serviceName
- the object namedepends
- the dependenciesincludeLifecycle
- the includes lifecycle flag
Exception
- for any errorpublic void register(ObjectName serviceName, Collection<ObjectName> depends, boolean includeLifecycle, Object target) throws Exception
serviceName
- the object namedepends
- the dependenciesincludeLifecycle
- the includes lifecycle flagtarget
- the target
Exception
- for any errorpublic void create(ObjectName serviceName) throws Exception
ServiceControllerMBean
create
in interface ServiceControllerMBean
serviceName
- Description of Parameter
Exception
- Description of Exceptionpublic void create(ObjectName serviceName, Collection<ObjectName> depends) throws Exception
ServiceControllerMBean
create
in interface ServiceControllerMBean
serviceName
- Description of Parameterdepends
- the dependencies
Exception
- Description of Exceptionpublic void start(ObjectName serviceName) throws Exception
ServiceControllerMBean
start
in interface ServiceControllerMBean
serviceName
- Description of Parameter
Exception
- Description of Exceptionpublic void restart(ObjectName serviceName) throws Exception
ServiceControllerMBean
restart
in interface ServiceControllerMBean
serviceName
- Description of Parameter
Exception
- Description of Exceptionpublic void stop(ObjectName serviceName) throws Exception
ServiceControllerMBean
stop
in interface ServiceControllerMBean
serviceName
- Description of Parameter
Exception
- Description of Exceptionpublic void destroy(ObjectName serviceName) throws Exception
ServiceControllerMBean
destroy
in interface ServiceControllerMBean
serviceName
- Description of Parameter
Exception
- Description of Exceptionpublic void remove(ObjectName objectName) throws Exception
ServiceControllerMBean
remove
in interface ServiceControllerMBean
objectName
- Description of Parameter
Exception
- Description of Exceptionpublic ServiceContext getServiceContext(ObjectName serviceName)
ServiceControllerMBean
getServiceContext
in interface ServiceControllerMBean
serviceName
- the service name
public void shutdown()
ServiceControllerMBean
shutdown
method here.
shutdown
in interface ServiceControllerMBean
public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
preRegister
in interface MBeanRegistration
Exception
public void postRegister(Boolean registrationDone)
postRegister
in interface MBeanRegistration
public void preDeregister() throws Exception
preDeregister
in interface MBeanRegistration
Exception
public void postDeregister()
postDeregister
in interface MBeanRegistration
public void sendControllerNotification(String type, ObjectName serviceName)
type
- the notification typeserviceName
- the service name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |