org.jboss.varia.deployment
Class BeanShellScript

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.jboss.system.ServiceDynamicMBeanSupport
              extended by org.jboss.varia.deployment.BeanShellScript
All Implemented Interfaces:
DynamicMBean, MBeanRegistration, NotificationBroadcaster, NotificationEmitter, org.jboss.kernel.spi.dependency.KernelControllerContextAware, Service, ServiceMBean

public class BeanShellScript
extends ServiceDynamicMBeanSupport

A wrapper service that exposes a BeanShell script as a JBoss service MBean.

Version:
$Revision: 81038 $
Author:
Sacha Labourey.
See Also:
BeanShellSubDeployer

Nested Class Summary
 class BeanShellScript.InvocationCouple
           
 
Field Summary
protected  ObjectName[] dependsServices
           
protected  DeploymentInfo deploymentInfo
           
protected  MBeanInfo mbeanInfo
           
protected  String name
           
protected  ObjectName preferedObjectName
           
protected  ScriptService scriptService
           
protected  HashMap supportedInterfaces
           
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
BeanShellScript(DeploymentInfo di)
          Deprecated. 
BeanShellScript(URL url)
           
 
Method Summary
protected  void createService()
           
protected  void destroyService()
           
protected  MBeanInfo generateMBeanInfo(Class[] intfs)
           
 ObjectName[] getDependsServices()
           
protected  Object getInternalAttribute(String attribute)
           
 MBeanInfo getMBeanInfo()
           
 ObjectName getPreferedObjectName()
           
protected  void init(URL url)
           
protected  Object internalInvoke(String actionName, Object[] params, String[] signature)
           
protected  void loadScript(InputStream stream)
          Load script.
protected  void loadScript(URL url)
           
protected  BeanShellScript.InvocationCouple retrieveCompatibleInvocation(String name, Class[] signature)
           
protected  BeanShellScript.InvocationCouple retrieveCompatibleInvocation(String name, String[] signature)
           
protected  void setInternalAttribute(Attribute attribute)
           
protected  void startService()
           
protected  void stopService()
           
 
Methods inherited from class org.jboss.system.ServiceDynamicMBeanSupport
getAttribute, getAttributes, getInternalAttributeInfo, getInternalConstructorInfo, getInternalDescription, getInternalNotificationInfo, getInternalOperationInfo, invoke, setAttribute, setAttributes
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, destroy, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, pojoChange, pojoCreate, pojoDestroy, pojoStart, pojoStop, postDeregister, postRegister, preDeregister, preRegister, setKernelControllerContext, start, stop, unsetKernelControllerContext
 
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

deploymentInfo

protected DeploymentInfo deploymentInfo

name

protected String name

scriptService

protected ScriptService scriptService

preferedObjectName

protected ObjectName preferedObjectName

dependsServices

protected ObjectName[] dependsServices

supportedInterfaces

protected HashMap supportedInterfaces

mbeanInfo

protected MBeanInfo mbeanInfo
Constructor Detail

BeanShellScript

@Deprecated
public BeanShellScript(DeploymentInfo di)
                throws DeploymentException
Deprecated. 

Throws:
DeploymentException

BeanShellScript

public BeanShellScript(URL url)
                throws DeploymentException
Throws:
DeploymentException
Method Detail

init

protected void init(URL url)
             throws DeploymentException
Throws:
DeploymentException

getInternalAttribute

protected Object getInternalAttribute(String attribute)
                               throws AttributeNotFoundException,
                                      MBeanException,
                                      ReflectionException
Overrides:
getInternalAttribute in class ServiceDynamicMBeanSupport
Throws:
AttributeNotFoundException
MBeanException
ReflectionException

setInternalAttribute

protected void setInternalAttribute(Attribute attribute)
                             throws AttributeNotFoundException,
                                    InvalidAttributeValueException,
                                    MBeanException,
                                    ReflectionException
Overrides:
setInternalAttribute in class ServiceDynamicMBeanSupport
Throws:
AttributeNotFoundException
InvalidAttributeValueException
MBeanException
ReflectionException

internalInvoke

protected Object internalInvoke(String actionName,
                                Object[] params,
                                String[] signature)
                         throws MBeanException,
                                ReflectionException
Overrides:
internalInvoke in class ServiceDynamicMBeanSupport
Throws:
MBeanException
ReflectionException

getMBeanInfo

public MBeanInfo getMBeanInfo()
Specified by:
getMBeanInfo in interface DynamicMBean
Overrides:
getMBeanInfo in class ServiceDynamicMBeanSupport

createService

protected void createService()
                      throws Exception
Overrides:
createService in class ServiceMBeanSupport
Throws:
Exception

startService

protected void startService()
                     throws Exception
Overrides:
startService in class ServiceMBeanSupport
Throws:
Exception

stopService

protected void stopService()
                    throws Exception
Overrides:
stopService in class ServiceMBeanSupport
Throws:
Exception

destroyService

protected void destroyService()
                       throws Exception
Overrides:
destroyService in class ServiceMBeanSupport
Throws:
Exception

retrieveCompatibleInvocation

protected BeanShellScript.InvocationCouple retrieveCompatibleInvocation(String name,
                                                                        String[] signature)
                                                                 throws ClassNotFoundException
Throws:
ClassNotFoundException

retrieveCompatibleInvocation

protected BeanShellScript.InvocationCouple retrieveCompatibleInvocation(String name,
                                                                        Class[] signature)
                                                                 throws ClassNotFoundException
Throws:
ClassNotFoundException

loadScript

protected void loadScript(URL url)
                   throws Exception
Throws:
Exception

loadScript

protected void loadScript(InputStream stream)
                   throws Exception
Load script. Stream should/must be closed/handled by the client invoking this method.

Parameters:
stream - the stream
Throws:
Exception - for any error

generateMBeanInfo

protected MBeanInfo generateMBeanInfo(Class[] intfs)
                               throws IntrospectionException
Throws:
IntrospectionException

getPreferedObjectName

public ObjectName getPreferedObjectName()

getDependsServices

public ObjectName[] getDependsServices()


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.