org.objectweb.jonas.server
Class J2EEServerMBean

java.lang.Object
  extended byorg.apache.commons.modeler.BaseModelMBean
      extended byorg.objectweb.jonas.server.J2EEServerMBean
All Implemented Interfaces:
javax.management.DynamicMBean, javax.management.MBeanRegistration, javax.management.modelmbean.ModelMBean, javax.management.modelmbean.ModelMBeanNotificationBroadcaster, javax.management.NotificationBroadcaster, javax.management.PersistentMBean

public class J2EEServerMBean
extends org.apache.commons.modeler.BaseModelMBean

MBean class for Server management. Two classes are used to provide all management services : J2EEServer and J2EEServerMBean. This class provide the notification's process when add or remove resources.

Author:
Adriana Danes, Michel-Ange Anton

Field Summary
 
Fields inherited from class org.apache.commons.modeler.BaseModelMBean
attributeBroadcaster, attributes, generalBroadcaster, info, oname, registry, resource, resourceType, source
 
Constructor Summary
J2EEServerMBean()
           
 
Method Summary
static void addDeployedObject(java.lang.String p_DeployedObject)
          Add a deployed object in the list of the J2EEServer.
 void addNotificationListener(javax.management.NotificationListener p_Listner, javax.management.NotificationFilter p_Filter, java.lang.Object p_Handback)
          Add a new listener.
static void addResource(java.lang.String p_ObjectName)
          Add an object name to the resources list.
 java.lang.String deployEar(java.lang.String fileName)
          Deploy a J2EE application packaged in a EAR file
 java.lang.String deployJar(java.lang.String fileName)
          Deploy a stand-alone J2EE module packaged in a JAR file
 java.lang.String deployRar(java.lang.String fileName)
          Deploy a J2EE application packaged in a RAR file
 java.lang.String[] getDeployedObjects()
          All The MBean names corresponding to the deployed J2EEModules (ear, jar, war, rar).
 java.lang.String[] getJavaVMs()
          All The MBean names corresponding to the used JVMs.
 java.lang.String[] getResources()
          All The MBean names corresponding to the deployed J2EEResources.
static void removeDeployedObject(java.lang.String p_DeployedObject)
          Remove a deployed object from the list of the J2EEServer.
static java.lang.String removeResource(java.lang.String p_ObjectName)
          Remove an object name from the resources list.
 void sendNotification(javax.management.Notification p_Notification)
          Send a notification to the listener.
 
Methods inherited from class org.apache.commons.modeler.BaseModelMBean
addAttributeChangeNotificationListener, createDefaultModelMBeanInfo, createResource, getAttribute, getAttributes, getClassName, getManagedResource, getMBeanInfo, getModelerType, getNotificationInfo, getObjectName, getRegistry, initModelInfo, invoke, isModelMBeanInfoValid, load, postDeregister, postRegister, preDeregister, preRegister, removeAttributeChangeNotificationListener, removeAttributeChangeNotificationListener, removeNotificationListener, removeNotificationListener, removeNotificationListener, sendAttributeChangeNotification, sendAttributeChangeNotification, sendNotification, setAttribute, setAttributes, setManagedResource, setModeledType, setModelMBeanInfo, setRegistry, store, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

J2EEServerMBean

public J2EEServerMBean()
                throws javax.management.MBeanException
Method Detail

getDeployedObjects

public java.lang.String[] getDeployedObjects()
All The MBean names corresponding to the deployed J2EEModules (ear, jar, war, rar).

Returns:
The String's array of deployed modules objects names

getResources

public java.lang.String[] getResources()
All The MBean names corresponding to the deployed J2EEResources.

Returns:
The String's array of deployed resources objects names

getJavaVMs

public java.lang.String[] getJavaVMs()
All The MBean names corresponding to the used JVMs.

Returns:
The String's array of used JVMs objects names

sendNotification

public void sendNotification(javax.management.Notification p_Notification)
Send a notification to the listener.


addNotificationListener

public void addNotificationListener(javax.management.NotificationListener p_Listner,
                                    javax.management.NotificationFilter p_Filter,
                                    java.lang.Object p_Handback)
                             throws java.lang.IllegalArgumentException
Add a new listener.

Throws:
java.lang.IllegalArgumentException

deployJar

public java.lang.String deployJar(java.lang.String fileName)
                           throws java.lang.Exception
Deploy a stand-alone J2EE module packaged in a JAR file

Returns:
The ObjectName of the MBean associated to the deployed module
Throws:
java.lang.Exception

deployEar

public java.lang.String deployEar(java.lang.String fileName)
                           throws java.lang.Exception
Deploy a J2EE application packaged in a EAR file

Returns:
The ObjectName of the MBean associated to the deployed J2EE Application
Throws:
java.lang.Exception

deployRar

public java.lang.String deployRar(java.lang.String fileName)
                           throws java.lang.Exception
Deploy a J2EE application packaged in a RAR file

Returns:
The ObjectName of the MBean associated to the deployed J2EE Application
Throws:
java.lang.Exception

addDeployedObject

public static void addDeployedObject(java.lang.String p_DeployedObject)
Add a deployed object in the list of the J2EEServer.

Parameters:
p_DeployedObject - The object name of deployed object

removeDeployedObject

public static void removeDeployedObject(java.lang.String p_DeployedObject)
Remove a deployed object from the list of the J2EEServer.

Parameters:
p_DeployedObject - The object name of deployed object

addResource

public static void addResource(java.lang.String p_ObjectName)
Add an object name to the resources list.

Parameters:
p_ObjectName - Object name correspondig to a J2EEResource MBean

removeResource

public static java.lang.String removeResource(java.lang.String p_ObjectName)
Remove an object name from the resources list.

Parameters:
p_ObjectName - Object name correspondig to a J2EEResource MBean
Returns:
Object name to the removed J2EEResource MBean