org.jboss.management.j2ee
Class JavaMailResource

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.management.j2ee.J2EEManagedObject
          extended by org.jboss.management.j2ee.J2EEResource
              extended by org.jboss.management.j2ee.JavaMailResource
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, EventProvider, J2EEManagedObjectMBean, J2EEResourceMBean, JavaMailResourceMBean, StateManageable

public class JavaMailResource
extends J2EEResource
implements JavaMailResourceMBean

Root class of the JBoss JSR-77 implementation of JavaMailResource.

Version:
$Revision: 57197 $
Author:
Andreas Schaefer, Scott Stark, Thomas Diesler

Field Summary
 
Fields inherited from class org.jboss.management.j2ee.J2EEManagedObject
NAME, server, TYPE
 
Fields inherited from interface org.jboss.management.j2ee.StateManageable
CREATED, DESTROYED, FAILED, REGISTERED, RUNNING, STARTING, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
JavaMailResource(String resName, javax.management.ObjectName j2eeServerName, javax.management.ObjectName mailServiceName)
           
 
Method Summary
static javax.management.ObjectName create(javax.management.MBeanServer mbeanServer, String resName, javax.management.ObjectName mailServiceName)
           
static void destroy(javax.management.MBeanServer mbeanServer, String resName)
           
 String getconfiguration()
           
 String getEventType(int pIndex)
          Returns the given Type of Events it emits according to its index in the list
 String[] getEventTypes()
           
 String getjndiName()
           
 long getStartTime()
           
 int getState()
           
 String getStateString()
           
 String getuserName()
           
 void mejbStart()
          Starts this SMO which can only be invoked when the SMO is in the State stopped.
 void mejbStartRecursive()
          Starts this SMO like start().
 void mejbStop()
          Stops this SMO which can only be into the running or starting.
 void postCreation()
           
 void preDestruction()
           
 void setconfiguration(String pConfigurationElement)
           
 void setjndiName(String pName)
           
 void setpassword(String pPassword)
           
 void setuserName(String pName)
           
 String toString()
           
 
Methods inherited from class org.jboss.management.j2ee.J2EEResource
getParentKeys
 
Methods inherited from class org.jboss.management.j2ee.J2EEManagedObject
addChild, getLog, getNextNotificationSequenceNumber, getobjectName, getObjectName, getparent, getServer, getType, getType, iseventProvider, isstateManageable, isstatisticsProvider, newObjectName, postDeregister, postRegister, preDeregister, preRegister, removeChild, removeObject, removeObject, sendNotification, setparent
 
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, wait, wait, wait
 
Methods inherited from interface org.jboss.management.j2ee.J2EEManagedObjectMBean
addChild, getobjectName, getparent, iseventProvider, isstateManageable, isstatisticsProvider, removeChild, setparent
 

Constructor Detail

JavaMailResource

public JavaMailResource(String resName,
                        javax.management.ObjectName j2eeServerName,
                        javax.management.ObjectName mailServiceName)
                 throws javax.management.MalformedObjectNameException,
                        InvalidParentException
Parameters:
resName - Name of the JavaMailResource
Throws:
javax.management.MalformedObjectNameException
InvalidParentException
Method Detail

create

public static javax.management.ObjectName create(javax.management.MBeanServer mbeanServer,
                                                 String resName,
                                                 javax.management.ObjectName mailServiceName)

destroy

public static void destroy(javax.management.MBeanServer mbeanServer,
                           String resName)

getuserName

public String getuserName()
                   throws Exception
Specified by:
getuserName in interface JavaMailResourceMBean
Throws:
Exception

setuserName

public void setuserName(String pName)
                 throws Exception
Specified by:
setuserName in interface JavaMailResourceMBean
Throws:
Exception

setpassword

public void setpassword(String pPassword)
                 throws Exception
Specified by:
setpassword in interface JavaMailResourceMBean
Throws:
Exception

getjndiName

public String getjndiName()
                   throws Exception
Specified by:
getjndiName in interface JavaMailResourceMBean
Throws:
Exception

setjndiName

public void setjndiName(String pName)
                 throws Exception
Specified by:
setjndiName in interface JavaMailResourceMBean
Throws:
Exception

getconfiguration

public String getconfiguration()
                        throws Exception
Specified by:
getconfiguration in interface JavaMailResourceMBean
Throws:
Exception

setconfiguration

public void setconfiguration(String pConfigurationElement)
                      throws Exception
Specified by:
setconfiguration in interface JavaMailResourceMBean
Throws:
Exception

getEventTypes

public String[] getEventTypes()
Specified by:
getEventTypes in interface EventProvider
Returns:
The actual list of Types of Events this Managed Object emits. The list is never null nor empty

getEventType

public String getEventType(int pIndex)
Description copied from interface: EventProvider
Returns the given Type of Events it emits according to its index in the list

Specified by:
getEventType in interface EventProvider
Parameters:
pIndex - Index of the requested Event Type
Returns:
Event Type if given Index is within the boundaries otherwise null

getStartTime

public long getStartTime()
Specified by:
getStartTime in interface StateManageable
Returns:
The Time (in milliseconds since 1/1/1970 00:00:00) that this managed object was started

getState

public int getState()
Specified by:
getState in interface StateManageable
Returns:
Current State of the SMO which could be either starting, running, stopping, stopped or failed

getStateString

public String getStateString()
Specified by:
getStateString in interface StateManageable
Returns:
Current State string from amont STARTING, RUNNING, STOPPING, STOPPED or FAILED

mejbStart

public void mejbStart()
Description copied from interface: StateManageable
Starts this SMO which can only be invoked when the SMO is in the State stopped. The SMO will go into the State started and after it completes successfully the SMO will go to the State running. The children of the SMO will not be started by this method call.

Attention: According to the specification this is named start() but in order to avoid name conflicts this is renamed to mejbStart(). The MEJB interface will make the conversion from start to mejbStart to make it transparent to the client.

Specified by:
mejbStart in interface StateManageable

mejbStartRecursive

public void mejbStartRecursive()
Description copied from interface: StateManageable
Starts this SMO like start(). After the SMO is started all its children in the State of stopped theirs startRecursive() are started too.

Attention: According to the specification this is named startRecursive() but in order to avoid name conflicts this is renamed to mejbStartRecursive(). The MEJB interface will make the conversion from startRecursive to mejbStartRecursive to make it transparent to the client.

Specified by:
mejbStartRecursive in interface StateManageable

mejbStop

public void mejbStop()
Description copied from interface: StateManageable
Stops this SMO which can only be into the running or starting. The State will change to stoping and after it completes successfully it will go into the State stopped. Afterwards all its children stop() method is called.

Attention: According to the specification this is named stop() but in order to avoid name conflicts this is renamed to mejbStop(). The MEJB interface will make the conversion from stop to mejbStop to make it transparent to the client.

Specified by:
mejbStop in interface StateManageable

postCreation

public void postCreation()
Overrides:
postCreation in class J2EEManagedObject

preDestruction

public void preDestruction()
Overrides:
preDestruction in class J2EEManagedObject

toString

public String toString()
Overrides:
toString in class J2EEManagedObject


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.