Java Reference
In-Depth Information
{
System.out.println( "Activate called" );
}
public void ejbPassivate()
{
System.out.println( "Passivate called" );
}
private Connection getConnection() throws Exception
{
InitialContext newCTX = null;
try
{
if( ds != null )
return ds.getConnection();
newCTX = new InitialContext();
ds = ( javax.sql.DataSource )
newCTX.lookup( "exampleDataSource" );
return ds.getConnection();
}
catch( Exception e )
{
throw new EJBException( e );
}
}
E
Register
MBean
private void installEJBMBean ()
{
try
{
MBeanServer mbs = getMBeanServer();
WorkflowManager wm = new WorkflowManager( clientID,
"workflowBean " );
ObjectName obn = new ObjectName( mbs.getDefaultDomain(),
"clientID", clientID );
mbs.registerMBean( wm , obn );
}
catch( Exception e )
{
e.printStackTrace();
}
}
F
Remove
MBean
private void removeEJBMBean ()
{
try
{
MBeanServer mbs = getMBeanServer();
Search WWH ::




Custom Search