Die Initialisierung eines AdaptorClient geschieht in zwei Schritten:
...
// String runtimeSelectedString kann beispielsweise
// com.sun.jaw.impl.adaptor.rmi.AdaptorClient
// sein.
Class adaptorClient = Class.forName(runtimeSelectedString);
AdaptorMO MOFactory
= (AdaptorMO) adaptorClient.newInstance();
connect
erreicht. In dem Methodenaufruf müssen folgende Parameter
spezifiziert werden:
// Aufbau eines AdaptorClient mit HTTP-Protokoll und
// Authentifizierung
...
import com.sun.jaw.impl.adaptor.http.AdaptorClient;
import com.sun.jaw.impl.adaptor.comm.*;
...
AdaptorClient adaptor
= new AdaptorClient();
// Authentifizierzung festlegen
AuthInfo security = new AuthInfo("root", "RootPassword");
// Verbindung mit HTTP-Adaptor auf JDMK-Agenten-Seite
try {
adaptor.connect(security, JDMKAgentHost, JDMKAgentPort, ServiceName.ART_HTTP);
} catch (UnauthorizedSecurityException e) {
// Process
}