BEA WebLogic Server WebLogic RMI BEA WebLogic Server 6.1 : 2002 6 24
Copyright 2002 BEA Systems, Inc. All Rights Reserved. BEA Systems, Inc. BEA BEA BEA FAR 52.227-19 Commercial Computer Software-Restricted Rights (c)(1) DFARS 252.227-7013 Rights in Technical Data and Computer Software (c)(1)(ii) NASA FAR 16-52.227-86 Commercial Computer Software--Licensing (d) BEA BEA BEA Jolt Tuxedo WebLogic BEA Systems, Inc. BEA Builder BEA Campaign Manager for WebLogic BEA elink BEA Manager BEA WebLogic Collaborate BEA WebLogic Commerce Server BEA WebLogic E-Business Platform BEA WebLogic Enterprise BEA WebLogic Integration BEA WebLogic Personalization Server BEA WebLogic Process Integrator BEA WebLogic Server E-Business Control Center How Business Becomes E-Business Liquid Data Operating System for the Internet Portal FrameWork BEA Systems, Inc. 2002 6 24 BEA WebLogic Server 6.1
... v e-docs Web... v... vi... vi... vi...viii 1. WebLogic RMI WebLogic RMI...1-1 WebLogic RMI...1-2 2. WebLogic RMI...2-1...2-2...2-3...2-7...2-8...2-8 RMI...2-9...2-9...2-10 WebLogic RMI...2-10 WebLogic RMI...2-11 JNDI...2-11 rmi.rmisecuritymanager...2-11 rmi.registry.locateregistry...2-12 rmi.server...2-12 setsecuritymanager...2-13...2-13 RMI T3...2-14 iii
3. WebLogic RMI WebLogic RMI API...3-1 WebLogic RMi...3-2...3-3 1....3-3 2....3-4 3. Java...3-6 4. RMI...3-6 5....3-7...3-8 iv
Sun Microsystems JavaSoft Remote Method Invocation RMI BEA WebLogic Server RMI BEA 1 2 WebLogic Server RMI 3 WebLogic RMI API WebLogic RMI Remote Method Invocation RMI e- Web Java e-docs Web BEA BEA Web BEA [ ] v
Web [ ] Web 1 PDF Web PDF Adobe Acrobat Reader PDF WebLogic Server [ ] Adobe Acrobat Reader Adobe Web http://www.adobe.co.jp BEA Web WebLogic Server WebLogic RMI over IIOP WebLogic RMI over IIOP Internet Inter-ORB Protocol IIOP RMI RMI BEA docsupport-jp@bea.com BEA vi
BEA WebLogic Server BEA WebLogic Server BEA WebSUPPORT www.bea.com BEA vii
Ctrl + Tab Java : import java.util.enumeration; chmod u+w * config/examples/applications.java config.xml float : String CustomerName; : LPT1 BEA_HOME OR { } viii
[ ] : java utils.multicasttest -n name -a address [-p portnumber] [-t timeout] [-s send] : java weblogic.deploy [list deploy undeploy update] password {application} {source}...... ix
x
WebLogic RMI 1 WebLogic RMI WebLogic RMI WebLogic RMI WebLogic RMI Remote Method Invocation RMI Java RMI RMI Java Java JVM WebLogic JavaSoft RMI WebLogic RMI WebLogic Server WebLogic Server RMI import JavaSoft RMI WebLogic RMI 1-1
WebLogic RMI WebLogic RMI WebLogic Java Naming and Directory Interface JNDI WebLogic RMI JNDI API RMI JavaSoft Web RMI tutorial WebLogic RMI JavaSoft RMI WebLogic RMI JVM RMI WebLogic RMI RMI WebLogic 1-1 WebLogic RMI WebLogic Server WebLogic Server JavaSort RMI PC 1000 RMI 1-2
WebLogic RMI 1-1 WebLogic RMI WebLogic JDBC 1 WebLogic RMI RMI WebLogic RMI WebLogic Server 1-2 WebLogic RMI rmic WebLogic RMI IIOP rmic throws java.rmi.remoteexception RuntimeException 1-3
WebLogic RMI 1-2 WebLogic RMI RMI Java JVM JVM JVM WebLogic Server WebLogic RMI SSL ACL RMI WebLogic RMI setsecuritymanager() UnicastRemoteObject rmi.server UnicastRemoteObject rmi.server RMI WebLogic Server 1-4
WebLogic RMI 1-3 WebLogic RMI WebLogic JNDI JNDI API JNDI LDAP NDS RMI URL rmi:// https:// iiop:// http:// http:// WebLogic RMI HTTP WebLogic Server 1-5
1 WebLogic RMI 1-6
WebLogic RMI 2 WebLogic Server RMI WebLogic RMI RMI WebLogic RMI WebLogic RMI RMI T3 WebLogic RMI WebLogic RMI weblogic.rmic) RMI rmic : IIOP rmic WebLogic RMI over IIOP Internet Inter-ORB Protocol IIOP RMI RMI RMI over IIOP WebLogic RMI over IIOP 2-1
2 RMI Weblogic Server RMI WebLogic Server WebLogic Server 6.1 rmic rmic XML 6.1 6.1 WebLogic Server rmic RMI EJB weblogic.ejbc 6.1 WebLogic Server 6.1 weblogic.ejbc WebLogic JavaBeans weblogic.rmic weblogic.ejbc 2-2
WebLogic RMI Java -d \classes examples.hello.helloimpl Java Java java weblogic.rmic java weblogic.rmic 2-1 -callrouter <callrouterclass> -clusterable -commentary -dispatchpolicy <queuename> -clusterable weblogic.rmi.cluster.callrouter null null WebLogic WebLogic Server 2-3
2 -help -idl -idloverwrite -idlverbose -idlstrict -idlnofactories -idldirectory <idldirectory> -iiop -iiopdirectory -keepgenerated -loadalgorithm <algorithm> -methodsareidempotent IDL IDL IDL OMG IDL valuetype IDL IIOP IIOP -clusterable weblogic.cluster.loadalgorithm 1 -clusterable _ 2-4
WebLogic RMI -nomanglednames -replicalistrefreshint erval <seconds> -sticktofirstserver -version -clusterable 180 -clusterable 2-2 WebLogic RMI -callrouter <callrouterclass> -clusterable -clusterable weblogic.rmi.cluster.callrouter null null WebLogic 2-5
2 -loadalgorithm <algorithm> -methodsareidempotent -replicalistrefreshint erval <seconds> -sticktofirstserver -clusterable weblogic.cluster.loadalgorithm 1 -clusterable Administration Console $ java weblogic.rmic -clusterable -loadalgorithm=weight-based -clusterable -clusterable 180 -clusterable 2-6
WebLogic RMI weblogic.rmic RMI 3 A B C 2 A B 3 3 JNDI 2 RMI false JNDI JNDI A A B B C NameNotFoundException A B B C NameNotFoundException RMI false JNDI JNDI JNDI 2-7
2 RMI true JNDI 1 WebLogic Server WebLogic Server RMI WebLogic Server RMI JNDI RemoteException RuntimeException 2-8
RMI RMI RMI Java JVM JVM JVM JVM RMI example.hello.helloimpl counter.example.ciaoimpl example.hello.hello 1 WebLogic RMI -nomanglednames 2-9
2 final rmic WebLogic Server WebLogic Server weblogic.rmic WebLogic RMI WebLogic Server RMI RMI JDBC RMI RMI WebLogic RMI WebLogic RMI WebLogic Server rmi:// http:// https:// JNDI 2-10
WebLogic RMI WebLogic RMI java.rmi RMIClassLoader java.rmi.server.remoteserver.getclienthost() JNDI Java Naming and Directory Interface JDNI JNDI Java API JNDI Sun Microsystems Java 2 Enterprise Edition J2EE RMI RMI JNDI JNDI rmi.rmisecuritymanager rmi.rmi SecurityManager JavaSoft WebLogic RMI WebLogic SSL Secure Socket Layer ACL 2-11
2 rmi.registry.locateregistry rmi.registry.locateregistry LocateRegistry.createRegistry(int port) JNDI JNDI WebLogic Server JNDI : rmi URL LocateRegistry.getRegistry(https://localhost:7002); SSL WebLogic 7002 WebLogic Server rmi.server rmi.server.logstream write(byte[]) WebLogic Server JavaSoft rmi.server.remoteobject UnicastRemoteObject WebLogic RMI proxy rmi.server.remoteserver rmi.server.unicastremoteobject getclienthost() rmi.server.unicastremoteobject WebLogic RMI Proxy final Object 2-12
WebLogic RMI RMI Java JVM : CLASSPATH setsecuritymanager setsecuritymanager() WebLogic RMI WebLogic Server 1 if (System.getSecurityManager() == null) System.setSecurityManager(new RMISecurityManager()); WebLogic RMI rmi.dgc.lease rmi.dgc.vmid rmi.server.objid rmi.server.operation rmi.server.rmiclassloader rmi.server.rmisocketfactory rmi.server.uid 2-13
2 RMI T3 WebLogic Server RMI T3 T3 WebLogic Server Java ( WebLogic Server ) Java (JVM) JVM T3 1 Java WebLogic Server Bean JDBC WebLogic Server JVM JVM T3 EJB JDBC T3 2 Java ( 2 Java ) ( ) 60 4 ( ) 240 4 2-14
3 WebLogic RMI WebLogic RMI API WebLogic RMI API WebLogic RMI API WebLogic RMi WebLogic RMI API WebLogic Server API RMI WebLogic WebLogic RMI API RMI import java.rmi.remote 3-1
3 WebLogic RMI JavaSoft RMI java.rmi.naming lookup() WebLogic JNDI WebLogic RMI JNDI WebLogic RMI java.rmi WebLogic RMi WebLogic Server RMI 1. 2. 3. Java 4. RMI 5. 3-2
WebLogic RMi 1. Java java.rmi.remote Sun Microsystems JavaSoft Creating Interfaces JavaSoft RMI throws java.rmi.remoteexception RuntimeException WebLogic RMI java.rmi.remoteexception RMI sayhello() package examples.rmi.multihello; import java.rmi.*; public interface Hello extends java.rmi.remote { String sayhello() throws RemoteException; } 3-3
3 WebLogic RMI JavaSoft RMI 1 2. Java 1 JavaSoft RMI UnicastRemoteObject HelloImpls sayhello() Hello package examples.rmi.multihello; import java.rmi.*; public class HelloImpl implements Hello { private String name; public HelloImpl(String s) throws RemoteException { name = s; } 3-4
WebLogic RMi public String sayhello() throws RemoteException { return "Hello!From " + name; } main() URL RMI rmi://hostname:port/remoteobjectname hostname port RMI remoteobjectname rmi: WebLogic Server 1099 remoteobjectname RMI RMI HelloImpl main() WebLogic Server MultiHelloServer HelloImpl public static void main(string[] argv) { // WebLogic RMI // System.setSecurityManager(new RmiSecurityManager()); // // // if (System.getSecurityManager() == null) // System.setSecurityManager(new RmiSecurityManager()); int i = 0; try { for (i = 0; i < 10; i++) { HelloImpl obj = new HelloImpl("MultiHelloServer" + i); Naming.rebind("//localhost/MultiHelloServer" + i, obj); 3-5
3 WebLogic RMI System.out.println("MultiHelloServer" + i + " created."); } System.out.println("Created and registered " + i + " MultiHelloImpls."); } catch (Exception e) { System.out.println("HelloImpl error:" + e.getmessage()); e.printstacktrace(); } } WebLogic SSL ACL WebLogic Server 3. Java javac Java.java.class 4. RMI WebLogic RMI weblogic.rmic $ java weblogic.rmic nameofremoteclass nameofremoteclass $ java weblogic.rmic examples.rmi.hello.helloimpl -keepgenerated 2-3 3-6
WebLogic RMi nameofinterface_proxy.class 3 main() URL WebLogic Server CLASSPATH 5. WebLogic Server Java WebLogic 1 Naming.lookup() WebLogic package mypackage.myclient; import java.rmi.*; public class HelloWorld throws Exception { // WebLogic // Hello hi = (Hello)Naming.lookup("HelloRemoteWorld"); // String message = hi.sayhello(); System.out.println(message); } Java 3-7
3 WebLogic RMI Hello package examples.rmi.hello; import java.rmi.*; public interface Hello extends java.rmi.remote { String sayhello() throws RemoteException; } HelloImpl package examples.rmi.hello; import java.rmi.*; public class HelloImpl // WebLogic RMI // extends UnicastRemoteObject implements Hello { public HelloImpl() throws RemoteException { super(); } public String sayhello() throws RemoteException { return "Hello Remote World!!"; } public static void main(string[] argv) { 3-8
WebLogic RMi } } try { HelloImpl obj = new HelloImpl(); Naming.bind("HelloRemoteWorld", obj); } catch (Exception e) { System.out.println("HelloImpl error:" + e.getmessage()); e.printstacktrace(); } 3-9
3 WebLogic RMI 3-10