
org.sapia.ubik.rmi.examples.FailOverEg Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sapia_ubik Show documentation
Show all versions of sapia_ubik Show documentation
A RMI-like distributed computing framework
The newest version!
package org.sapia.ubik.rmi.examples;
import org.sapia.ubik.rmi.naming.remote.RemoteInitialContextFactory;
import java.util.Properties;
import javax.naming.InitialContext;
/**
* @author Yanick Duchesne
*
* - Copyright:
- Copyright © 2002-2003 Sapia Open Source Software. All Rights Reserved.
* - License:
- Read the license.txt file of the jar or visit the
* license page at the Sapia OSS web site
*
*/
public class FailOverEg {
/**
* Constructor for LookUpEg.
*/
public FailOverEg() {
super();
}
public static void main(String[] args) {
try {
Properties props = new Properties();
props.setProperty(InitialContext.PROVIDER_URL, "ubik://localhost:1099");
props.setProperty(InitialContext.INITIAL_CONTEXT_FACTORY,
RemoteInitialContextFactory.class.getName());
InitialContext ctx = new InitialContext(props);
Object obj = ctx.lookup("Foo");
System.out.println("Looked up: " + obj.getClass().getName());
Foo f = (Foo) obj;
System.out.println("Waiting 10s...");
Thread.sleep(10000);
System.out.println("Performing call...");
System.out.println(f.getBar().getMsg());
} catch (Exception e) {
e.printStackTrace();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy