If its a standalone mbean(meaning it does not depend on jboss mbean services such
as Naming to be running) you can use the jboss.conf and JMX MLET tags as
before.

If the mbean has dependencies on jboss mbean services, you need to add its
configuration to jboss.jcml using mbean/attribute tags to setup the mbean. The
order of the mbeans in the jboss.jcml file defines the startup order of the services.
Your mbean needs to either implement the org.jboss.util.Service interface or at least
have 'public void start() throws Exception;' method in order for your mbean to
be started in the correct order. Interaction with other jboss services cannot be
done until the start method is called.

The syntax of the jboss.jcml mbean tags is:

<mbean code="full_class_name of mbean" name="JMX_name">
  <attribute name="Prop1Name">Prop1Value</attribute>
  <attribute name="Prop2Name">Prop2Value</attribute>
</mbean>

where Prop1Name is a JavaBean type of property for which there exists a
setProp1Name(Prop1Type value) method in your MBean interface. As an example,
here is the setup for the ExternalContext mbean using the jboss.conf/MLET tags and
the jboss.jcml/mbean tags,

jboss.conf:
<MLET code="org.jboss.naming.ExternalContext" ARCHIVE="jboss.jar" 
CODEBASE="../../lib/ext">
  <ARG TYPE="java.lang.String" VALUE="external:/ldap/dscape" >
  <ARG TYPE="java.lang.String" VALUE="dscape.ldap" >
</MLET>

jboss.jcml:
<mbean code="org.jboss.naming.ExternalContext" name=":server=ExternalContext>
  <attribute name="JndiName">external:/ldap/dscape</attribute>
  <attribute name="Properties">dscape.ldap</attribute>
</mbean>

The MBean interface looks like:
public interface ExternalContextMBean extends org.jboss.util.ServiceMBean
{
  public void setJndiName(String jndiName);
  public void setProperties(String contextPropsURL) throws IOException;
}

----- Original Message ----- 
From: Roberto Leong 
To: 'jBoss-user' 
Sent: Monday, January 15, 2001 4:01 PM
Subject: [jBoss-User] new MBean


hi

I know that there was a major change on configuring jboss, could someone please tell 
me how to configure a new MBean?

thanks
Roberto



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to