All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sapia.ubik.rmi.examples.UbikFoo Maven / Gradle / Ivy

The newest version!
package org.sapia.ubik.rmi.examples;

import org.sapia.ubik.rmi.naming.remote.RemoteInitialContextFactory;
import org.sapia.ubik.rmi.server.Log;

import java.rmi.RemoteException;

import java.util.Properties;

import javax.naming.*;


/**
 * @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 UbikFoo implements Foo { public UbikFoo() throws java.rmi.RemoteException { } /** * @see org.sapia.ubik.rmi.Foo#getBar() */ public Bar getBar() throws RemoteException { return new UbikBar(); } public static void main(String[] args) { try { Log.setWarning(); //PerfAnalyzer.getInstance().setEnabled(true); 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); ctx.rebind("Foo", new UbikFoo()); System.out.println("UbikFoo started..."); while (true) { Thread.sleep(10000); } } catch (Throwable t) { t.printStackTrace(); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy