01: /*
02: * Copyright (C) The MX4J Contributors.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the MX4J License version 1.0.
06: * See the terms of the MX4J License in the documentation provided with this software.
07: */
08: package mx4j.examples.mbeans.iiop;
09:
10: import javax.naming.InitialContext;
11: import javax.rmi.PortableRemoteObject;
12:
13: /**
14: * This example connects to an RMI over IIOP server and invoke the services it exposes,
15: * in this simple example it just calls {@link Hello#sayHello}.
16: *
17: * @version $Revision: 1.1 $
18: */
19: public class IIOPClient {
20: public static void main(String[] args) throws Exception {
21: InitialContext ctx = new InitialContext();
22: Hello remoteInterface = (Hello) PortableRemoteObject.narrow(ctx
23: .lookup(Hello.IIOP_JNDI_NAME), Hello.class);
24: remoteInterface.sayHello("from the MX4J Team");
25: }
26: }
|