All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class examples.agentbean.AgentMain

java.lang.Object
   |
   +----examples.agentbean.AgentMain

public class AgentMain
extends Object
implements Serializable
The AgentMain class provides a sample agent designed to be put in a jar file and then loaded into the BeanBox application.

This agent will be able to serve every bean instantiated in the BeanBox which contain the following registration lines in their constructor:

 try{
  ((Framework)AgentMain.getFramework()).addObject((Object)this, new ObjectName(((Framework)AgentMain.getFramework()).getDomain()+":examples.agentbean.TextSample"));
 } catch (Exception e) {
   e.printStackTrace();
 }
 

An example of a such bean is provided in TextSample.java source file.

The AgentMain must be the first element added in the BeanBox. Then, the other elements can register themself to the AgentMain.

In addition, the agent starts these managed object adaptor servers:

To manage the agent through a Web browser, point the Web browser at http://hostname :8082.


Constructor Index

 o AgentMain()

Method Index

 o getFramework()
Returns the Framework.
 o main(String[])
The main method does not allow you to specify command-line parameters.

Constructors

 o AgentMain
 public AgentMain()

Methods

 o main
 public static void main(String args[])
The main method does not allow you to specify command-line parameters. However, it does allow you to specify the trace level by using the DEBUG properties. For more information on trace levels, refer to Debug object.

 o getFramework
 public static Framework getFramework()
Returns the Framework.


All Packages  Class Hierarchy  This Package  Previous  Next  Index