当前位置: 首页>>代码示例>>Java>>正文


Java Registry.unbind方法代码示例

本文整理汇总了Java中java.rmi.registry.Registry.unbind方法的典型用法代码示例。如果您正苦于以下问题:Java Registry.unbind方法的具体用法?Java Registry.unbind怎么用?Java Registry.unbind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.rmi.registry.Registry的用法示例。


在下文中一共展示了Registry.unbind方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: unBind

import java.rmi.registry.Registry; //导入方法依赖的package包/类
/**
 * <p>
 * Un-bind the scheduler from an RMI registry.
 * </p>
 */
private void unBind() throws RemoteException {
    String host = resources.getRMIRegistryHost();
    // don't un-export if we're not configured to do so...
    if (host == null || host.length() == 0) {
        return;
    }

    Registry registry = LocateRegistry.getRegistry(resources
            .getRMIRegistryHost(), resources.getRMIRegistryPort());

    String bindName = resources.getRMIBindName();
    
    try {
        registry.unbind(bindName);
        UnicastRemoteObject.unexportObject(this, true);
    } catch (java.rmi.NotBoundException nbe) {
    }

    getLog().info("Scheduler un-bound from name '" + bindName + "' in RMI registry");
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:26,代码来源:QuartzScheduler.java

示例2: vaciarRegistroRMI

import java.rmi.registry.Registry; //导入方法依赖的package包/类
public static boolean vaciarRegistroRMI (Registry regtr) {
        if (regtr == null) return true;
//        ItfUsoRecursoTrazas trazas = Directorio.getRecursoTrazas();
             
//            NombresPredefinidos.REPOSITORIO_INTERFACES_OBJ = repositorioInterfaces;
        try {
             trazas.aceptaNuevaTraza(new InfoTraza ("AdaptadorRegRMI", "Vaciando registro RMI", NivelTraza.info));
            String [] listaRemotos = regtr.list();
            for (String obj : listaRemotos) regtr.unbind(obj);
            return true;
        } catch (Exception e) {
             trazas.aceptaNuevaTraza(new InfoTraza("AdaptadorRegRMI", "Fallo al vaciar registro RMI", NivelTraza.error));
            return false;
        }
    }
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:16,代码来源:AdaptadorRegRMI.java

示例3: main

import java.rmi.registry.Registry; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    Registry impl = TestLibrary.createRegistryOnUnusedPort();
    Registry stub = (Registry) RemoteObject.toStub(impl);
    stub.bind("", stub);
    stub.lookup("");
    stub.rebind("", stub);
    stub.lookup("");
    stub.unbind("");
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:10,代码来源:EmptyName.java

示例4: main

import java.rmi.registry.Registry; //导入方法依赖的package包/类
public static void main(String args[]) throws Exception {
    try {
        testPkg.Server obj = new testPkg.Server();
        testPkg.Hello stub = (testPkg.Hello) UnicastRemoteObject.exportObject(obj, 0);
        // Bind the remote object's stub in the registry
        Registry registry =
            LocateRegistry.getRegistry(TestLibrary.READTEST_REGISTRY_PORT);
        registry.bind("Hello", stub);

        System.err.println("Server ready");

        // now, let's test client
        testPkg.Client client =
            new testPkg.Client(TestLibrary.READTEST_REGISTRY_PORT);
        String testStubReturn = client.testStub();
        if(!testStubReturn.equals(obj.hello)) {
            throw new RuntimeException("Test Fails : unexpected string from stub call");
        } else {
            System.out.println("Test passed");
        }
        registry.unbind("Hello");

    } catch (Exception e) {
        System.err.println("Server exception: " + e.toString());
        e.printStackTrace();
    }

}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:29,代码来源:readTest.java

示例5: main

import java.rmi.registry.Registry; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    Registry impl = TestLibrary.createRegistryOnEphemeralPort();
    Registry stub = (Registry) RemoteObject.toStub(impl);
    stub.bind("", stub);
    stub.lookup("");
    stub.rebind("", stub);
    stub.lookup("");
    stub.unbind("");
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:EmptyName.java

示例6: main

import java.rmi.registry.Registry; //导入方法依赖的package包/类
public static void main(String args[]) throws Exception {
    Registry registry = null;
    int exit = 0;
    try {
        int port = Integer.valueOf(args[0]);

        testPkg.Server obj = new testPkg.Server();
        testPkg.Hello stub =
                (testPkg.Hello) UnicastRemoteObject.exportObject(obj, 0);
        // Bind the remote object's stub in the registry
        registry = LocateRegistry.getRegistry(port);
        registry.bind("Hello", stub);
        System.err.println("Server ready");

        testPkg.Client client = new testPkg.Client(port);
        String testStubReturn = client.testStub();
        if(!testStubReturn.equals(obj.hello)) {
            throw new RuntimeException("Test Fails : "
                    + "unexpected string from stub call");
        }
        registry.unbind("Hello");
        System.out.println("Test passed");
    } catch (Exception ex) {
        exit = EXIT_FAIL;
        ex.printStackTrace();
    }
    // need to exit explicitly, and parent process uses exit value
    // to tell if the test passed.
    System.exit(exit);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:31,代码来源:RegistryLookup.java


注:本文中的java.rmi.registry.Registry.unbind方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。