Package net.xeoh.plugins.remotediscovery

Examples of net.xeoh.plugins.remotediscovery.RemoteDiscovery


     */
    @Test
    public void testGetPluginClassOfP() {
        Assert.assertNotNull(this.pm);

        RemoteDiscovery plugin = this.pm.getPlugin(RemoteDiscovery.class);

        Assert.assertNull("Plugin must not be there at this point", plugin);

        this.pm.addPluginsFrom(ClassURI.PLUGIN(RemoteDiscoveryImpl.class));
        this.pm.addPluginsFrom(new ClassURI(RemoteDiscoveryImpl.class).toURI());
View Full Code Here


        System.out.println(p2);

        p.exportPlugin(p2);
        System.out.println("exported to " + p2);

        RemoteDiscovery plugin = this.pm.getPlugin(RemoteDiscovery.class);
        //while(true) {
        Collection<DiscoveredPlugin> discover = plugin.discover(Plugin.class, new OptionCallback(new OptionCallback.Callback() {

            public void pluginsDiscovered(Collection<DiscoveredPlugin> plugins) {
                ArrayList<DiscoveredPlugin> test = new ArrayList<DiscoveredPlugin>(plugins);
                for (DiscoveredPlugin discoveredPlugin : test) {
                    System.out.println("Callback says: " + discoveredPlugin.getPublishURI() + " @" + discoveredPlugin.getDistance());
View Full Code Here

     * @throws URISyntaxException  
     * @throws InterruptedException */
    @Test
    public void testDiscovery() throws URISyntaxException, InterruptedException {
        TestAnnotations p2 = this.pm.getPlugin(TestAnnotations.class);
        RemoteDiscovery p = this.pm.getPlugin(RemoteDiscovery.class);

        System.out.println(1);
        p.announcePlugin(p2, PublishMethod.ERMI, new URI("ermi://lala:123/Jojo"));
        System.out.println(2);
        Collection<DiscoveredPlugin> discover = p.discover(Plugin.class);
        System.out.println(3);
        for (DiscoveredPlugin dp : discover) {
            int distance = dp.getDistance();
            System.out.println(dp.getPublishURI() + " " + distance);
        }
View Full Code Here

TOP

Related Classes of net.xeoh.plugins.remotediscovery.RemoteDiscovery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.