org.objectweb.jonas.server
Class J2EEServerMBean

java.lang.Object
  extended by org.apache.commons.modeler.BaseModelMBean
      extended by org.objectweb.jonas.server.J2EEServerMBean
All Implemented Interfaces:
DynamicMBean, MBeanRegistration, ModelMBean, ModelMBeanNotificationBroadcaster, NotificationBroadcaster, 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()
          Default constructor.
 
Method Summary
 void addNotificationListener(NotificationListener pListner, NotificationFilter pFilter, Object pHandback)
          Add a new listener.
 String deployFile(Integer typeparam, Byte[] bfile, String filename, String[] genicArgs, Boolean moveIntoDeployableDirectory)
          Deploy file (GenIC), needed for Ishmael to work.
 String[] getDeployedObjects()
          All The MBean names corresponding to the deployed J2EEModules (ear, jar, war, rar).
 String[] getJavaVMs()
          All The MBean names corresponding to the used JVMs.
 String[] getResources()
          All The MBean names corresponding to the deployed J2EEResources.
 boolean removeModuleFile(String fileName)
          Remove a specified J2EE module
 String sendFile(byte[] fileContent, String fileName, boolean replaceExisting)
          Send a file to JOnAS Base with the given input stream and write it in the corresponding directory, ie JONAS_BASE/apps, JONAS_BASE/ejbjars, etc.
 String wsgenLocalFile(String pathname, Boolean unpacked)
          Apply WsGen on a local file and generate webservices artifacts
 
Methods inherited from class org.apache.commons.modeler.BaseModelMBean
addAttributeChangeNotificationListener, createDefaultModelMBeanInfo, createResource, getAttribute, getAttributes, getClassName, getJmxName, getManagedResource, getMBeanInfo, getModelerType, getNotificationInfo, getObjectName, getRegistry, initModelInfo, invoke, isModelMBeanInfoValid, load, postDeregister, postRegister, preDeregister, preRegister, removeAttributeChangeNotificationListener, removeAttributeChangeNotificationListener, removeNotificationListener, removeNotificationListener, removeNotificationListener, sendAttributeChangeNotification, sendAttributeChangeNotification, sendNotification, 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 MBeanException
Default constructor.

Throws:
MBeanException - if super constructor fails
Method Detail

getDeployedObjects

public 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 String[] getResources()
All The MBean names corresponding to the deployed J2EEResources.

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

getJavaVMs

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

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

addNotificationListener

public void addNotificationListener(NotificationListener pListner,
                                    NotificationFilter pFilter,
                                    Object pHandback)
                             throws IllegalArgumentException
Add a new listener.

Specified by:
addNotificationListener in interface NotificationBroadcaster
Overrides:
addNotificationListener in class org.apache.commons.modeler.BaseModelMBean
Parameters:
pListner - Listener to notify
pFilter - Notification filter
pHandback - ??
Throws:
IllegalArgumentException - if notification is not done

wsgenLocalFile

public String wsgenLocalFile(String pathname,
                             Boolean unpacked)
Apply WsGen on a local file and generate webservices artifacts

Parameters:
pathname - : local path name to the component
unpacked - true if we want to have an unpacked directory as result
Returns:
Returns the path to the modified archive

deployFile

public String deployFile(Integer typeparam,
                         Byte[] bfile,
                         String filename,
                         String[] genicArgs,
                         Boolean moveIntoDeployableDirectory)
Deploy file (GenIC), needed for Ishmael to work. The file is in the directory specified by the property "jonas.service.deployment.directory"

Parameters:
typeparam - type of the file (EJB, WAR, EAR, RAR, CAR)
bfile - bytes array of the file
filename - basename of the file to be deployed (if moveIntoDeployableDirectory full path name because local file)
genicArgs - arguments for GenIC
moveIntoDeployableDirectory - true to copy the file into the deployable JOnAS_BASE directory
Returns:
absolute path of the file
Throws:
RemoteException
EarServiceException
ResourceServiceException
JWebContainerServiceException

sendFile

public String sendFile(byte[] fileContent,
                       String fileName,
                       boolean replaceExisting)
                throws Exception
Send a file to JOnAS Base with the given input stream and write it in the corresponding directory, ie JONAS_BASE/apps, JONAS_BASE/ejbjars, etc. It is based on the filename extension

Parameters:
fileContent - the content (bytes) of the file
fileName - name of the file
replaceExisting - replace existing file if any
Returns:
the path of the file
Throws:
Exception - if file is already present and if the user don't want to replace existing file.

removeModuleFile

public boolean removeModuleFile(String fileName)
                         throws Exception
Remove a specified J2EE module

Parameters:
fileName - Name of file to remove
Returns:
true if file has been removed
Throws:
Exception - if remove fails


Copyright © 2007 OW2 Consortium. All Rights Reserved.