|
This section will be helpful for users who are using Multi-Protocol agents in the earlier versions of Agent Toolkit Java Edition and now wish to migrate to the latest release of the Toolkit. The document explains how to migrate between 4.2 to 5.1.0 and 5.1.0 to 6.0.0 release.
26.1 Migrating to Agent Toolkit 6.0.0
The following change needs to be made while migrating from 5.1.0 to 6.0.0
Modify the package structure:
The package structure has been modified for certain imports. The following table depicts the changes in package structure in 6.0.0 compared to 5.1.0:
| Package Structure in 5.1.0 | Package Structure in 6.0.0 |
|---|---|
|
com.adventnet.agent.utilities.common.* |
com.adventnet.utilities.common.* |
|
com.adventnet.agent.utilities.xml.XMLIntender |
com.adventnet.utilities.xml.indenter.XMLIntender |
|
com.adventnet.agent.logging |
com.adventnet.utilities.logging |
|
com.adventnet.agent.framework.xml |
com.adventnet.utilities.xml.sax |
|
com.adventnet.agent.utilities.xml |
com.adventnet.utilities.xml.dom |
Before generating the agent, you need to ensure that the latest package structure is followed.
26.2 Migrating to Agent Toolkit 5.1.0
The step by step procedure for migrating to release 5.1.0 is given below:
For easy migration, create a New Project with the JMX Compiler in 5.1.0 release product.
The source files for the new project will be generated under <Agent Toolkit Home>/jmxprojects/projectname/agent/src/ directory.
Remove all the generated files under this directory.
Move the source files of the agent developed using the previous release product and place them in the <Agent Toolkit Home>/jmxprojects/projectname/agent/src/ directory of the new project created using the latest release product.
Change the import statement as specified in "Package Structure Modified" section.
Modify the xml Location for all MBeans in the initialize( ) method of the agent main file.
If HtmlAdaptor is enabled,
Modify the location of HtmlNotif.ser file using htmladaptor.setLogFile() in the agent main file.
Then compile the Agent.
This will make your Agent work in 5.1.0 release.
26.3 Package Structure Modified
The Package structure for certain imports have been modified and before generation the older import statements have to be commented and new import statements have to be added in the source files generated in the previous version product. Package structure have been changed for the following import :
| Import statement to be Commented |
Import statement to be Included |
|---|---|
| import com.adventnet.common.agent.*; | import com.adventnet.agent.utilities.common.* |
| import com.adventnet.ssiparser.*; | import com.adventnet.html.dynamic.*; |
| import com.adventnet.utils.xml.*; | import com.adventnet.agent.utilities.xml.*; |
| import com.adventnet.clients.common.*; | import com.adventnet.adaptors.clients.*; |
| import com.adventnet.clients.rmi | import com.adventnet.adaptors.clients.rmi |
| import com.adventnet.clients.corba | import com.adventnet.adaptors.clients.corba |
| import com.adventnet.clients.http | import com.adventnet.adaptors.clients.http |
26.4 Jars Replaced
For easy migration, the latest jars have to be used instead of the existing jars. These jars are available in <Agent Toolkit Home>/jars directory of 5.1.0 release. The jars that have been changed:
xmojo.jar has been replaced with
xmojo.jar
AdventNetJmxAgent.jar and
AdventNetAgentRuntimeUtilities.jar
26.5 Adaptor Framework Changes
One of the major features of this release is the enhancement of Adaptor and Client Framework. The existing Adaptor Framework has been completely revamped. The major changes are documented in this section to enable you to switch over to the new Framework easily. The following classes and interfaces have been renamed:
Adaptor Classes
Interface ServiceInfo has been renamed as Interface Adaptor.
Class SimpleAdaptor has been renamed as Class AbstractAdaptor.
Client Classes
Class SimpleClient has been renamed as Class AbstractClient.
26.6 Changes made to ServiceInfo interface :
| Interface ServiceInfo |
Interface Adaptor |
|---|---|
|
isActive |
isActive |
|
stopService |
stopService throws IllegalStateException |
|
startService |
startService throws llegalStateException,Exception |
|
getAdaptorVersion |
getAdaptorVersion |
|
getProtocol |
getProtocol |
|
|
getHost |
|
|
getPort |
|
|
getState |
|
|
getStateInString |
|
|
setPort(int) throws IllegalStateException |
|
|
isSecure() |
|
|
getAdaptorObjectName() |
|
|
enableAuthentication(boolean)throws UnsupportedOperationException |
|
|
enableAuthorisation(boolean) throws UnsupportedOperationException |
26.7 Changes made to SimpleAdaptor class :
| SimpleAdaptor implements ServiceInfo |
AbstractAdaptor extends Thread implements Adaptor,MBeanRegistration,NotificationBroadcaster,Serializable |
|---|---|
| public isActive | public isActive |
| public stopService | public synchronized stopService() throws IllegalStateException |
| public startService | public synchronized startService() throws IllegalStateException |
| public getHost | |
| public getPort | |
| public abstract getProtocol * | |
| public getState | |
| public getStateinString | |
|
public setPort throws IllegalStateException | |
|
|
public isSecure |
|
|
public abstract enableAuthentication * |
| public abstract enableAuthorisation * | |
|
|
public getAdaptorVersion |
|
public abstract getAdaptorObjectName * | |
| public addNotificationListener | |
|
|
public removeNotificationListenet |
| public getNotificationInfo | |
| public preRegister | |
| public postRegister | |
| public preDeregister | |
| public postDeregister | |
| protected abstract instantiateAdaptor() throws instantiationException * | |
| protected abstract bind() * | |
| protected abstract unbind() * | |
| protected abstract processClientRequests * | |
| protected abstract destroyAdaptor * |
* These methods need to be implemented by the adaptors.
26.8 Changes made to ClientInfo Interface :
The Client interface extends from the MBeanServer instead of re-declaring them ( Hence the respective adaptors must implement de-serialize functions of the MBeanServer as well ).
| Interface ClientInfo | Interface Client |
|---|---|
| public interface ClientInfo | public interface Client extends MBeanServer |
| connect | connect |
| disconnect | disconnect |
| isConnectedWithAdaptor | isConnectedWithAdaptor |
| getAdaptorObjectName | Moved to Adaptor |
| getAdaptorVersion | Moved to Adaptor |
| enableHeartBeat | enableHeartBeat |
| isHeartBeatEnabled | isHeartBeatEnabled |
| getHeartBeatRate | getHeartBeatRate |
| setHeartBeatRate | setHeartBeatRate |
| addHeartBeatListener | addHeartBeatListener |
| removeHeartBeatListener | removeHeartBeatListener |
| MBeanServerFunctions | derives it from the super interface MBeanServer |
26.9 Changes in SimpleClient class :
SimpleClient is split into two classes AbstractClient and ClientFactory
AbstractClient implements all the heartbeat functions
|
Class Simple Client |
Class AbstractClient |
|---|---|
| createClient() | Moved to Class ClientFactory |
| abstract connect | abstract connect |
| abstract disconnect | abstract disconnect |
| abstract isConnectedWithAdaptor | abstract isConnectedWithAdaptor |
| abstract getAdaptorVersion | -- |
| abstract getAdaptorObjectName | -- |
| abstract enableHeartBeat | enableHeartBeat(boolean flag) Note: Not abstract. |
| abstract isHeartBeatEnabled | isHeartBeatEnabled () |
| abstract addHeartBeatListener | synchronized addHeartBeatListener |
| abstract removeHeartBeatListener | synchronized removeHeartBeatListener |
| asbtract getHeartBeatRate | getHeartBeatRate |
| abstract setHeatBeatRate(int rate) | setHeartBeatRate(int) |
| abstract sendHeartBeatEvent | |
| MBeanServerFunctions | -- |
26.10 Changes in setMethod Argument types for Discovery Service
If discovery service is enabled and setMutlicastPort and setTimetoLive methods are called, then the data type of the arguments should be changed from primitive 'int' to integer object, java.lang.integer.
|