26.0 Migration Guide for Multi-Protocol Agent

 

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:

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

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:

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()
Note:
This function was previously associated with the client.

 

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 :

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.

 

 

Copyright © 1996-2004, AdventNet Inc. All Rights Reserved.