Java Reference
In-Depth Information
new MBeanAttributeInfo( "State", "java.lang.String",
"Workflow state of client " + clientID,
true, true, false );
MBeanOperationInfo[] ops = new MBeanOperationInfo[ 1 ];
MBeanParameterInfo[] sig = new MBeanParameterInfo[ 0 ];
ops[0] = new MBeanOperationInfo( "advanceState",
"Advance the workflow", sig,
"void", MBeanOperationInfo.ACTION );
Class consig[] = { Class.forName( "java.lang.String" ),
Class.forName( "java.lang.String" ) };
Constructor construct =
this.getClass().getConstructor( consig );
MBeanConstructorInfo cons[] = new MBeanConstructorInfo[ 1 ];
cons[0] =
new MBeanConstructorInfo( "Constructor", construct );
MBeanInfo mbi = new MBeanInfo( this.getClass().getName(),
"Manages Workflow Entity EJB",
atts, cons, ops, null );
return mbi;
}
catch( Exception e )
{
e.printStackTrace();
}
return null;
}
public void setAttribute( Attribute att )
throws AttributeNotFoundException,
MBeanException,
ReflectionException,
InvalidAttributeValueException
{
if( att.getName().equals( "State" ) )
{
try
{
ejb.setState( ( String ) att.getValue() );
}catch( RemoteException re )
{
throw new MBeanException( re );
}
}
}
public AttributeList setAttributes( AttributeList list )
{
AttributeList rvalue = new AttributeList();
Search WWH ::




Custom Search