All Packages Class Hierarchy This Package Previous Next Index
Class examples.exception.Client
java.lang.Object
|
+----examples.exception.Client
- public class Client
- extends Object
- implements Runnable
The Client implements a simple management application
illustrating how to deal with exception handling.
The application performs the following tasks:
- Set up communication using the RMI client adaptor.
- Instantiate a simple m-bean in a remote agent.
- Access and modify properties of a remote m-bean.
The application deals with exception handling and catchs 3 different exceptions:
- JawException can occur
when instantiating a simple m-bean that is already registered in the agent for example.
You can generate such an exception by starting the client application twice in succession.
- JawRuntimeException can occur
when trying to connect to an agent for example.
You can generate such an exception by starting the client application without running agent.
- Exception.
Prior to starting the client application, make sure an agent is running.
For instance you can use the sample agent provided.
If you use a different agent, keep in mind that the client application uses the
RMI adaptor for communicating with the agent.
In order to start the client, you need to invoke the following command:
java examples.exception.Client [hostname]
where hostname is the name of the machine where the agent is running.
By default it is the local host.
The Client implements Runnable and can also be started using the Bootstrap service.
-
Client()
-
-
main(String[])
- It is possible to specify on the command line the implementation to use
for the adaptor function.
-
run()
- When an object implementing interface Runnable is used to create a thread,
starting the thread causes the object's run method to be called in that
separately executing thread.
Client
public Client()
main
public static void main(String argv[])
- It is possible to specify on the command line the implementation to use
for the adaptor function.
In particular, it is possible to specify the host name where the
agent is running.
run
public void run()
- When an object implementing interface Runnable is used to create a thread,
starting the thread causes the object's run method to be called in that
separately executing thread.
All Packages Class Hierarchy This Package Previous Next Index