Package org.drools.grid

Examples of org.drools.grid.GridServiceDescription


                                              emf );
    }

    public GridServiceDescription lookup(String serviceDescriptionId) {
        EntityManager em = this.emf.createEntityManager();
        GridServiceDescription gsd = em.find( GridServiceDescriptionImpl.class,
                                                                          serviceDescriptionId );
        em.close();
        return (gsd == null) ? null : new GridServiceDescriptionJpa( gsd,
                                                                     emf );
    }
View Full Code Here


        GridServiceDescription<WhitePages> wpGsd = getGsd();
        InetSocketAddress[] sockets = (InetSocketAddress[]) ((Address) wpGsd.getAddresses().get( "socket" )).getObject();
        CommandImpl cmd = new CommandImpl( "WhitePages.create",
                                           Arrays.asList( new Object[]{serviceDescriptionId} ) );
        ConversationManager convm = this.grid.get( ConversationManager.class );
        GridServiceDescription gsd = (GridServiceDescription) sendMessage( convm,
                                                                           sockets,
                                                                           wpGsd.getId(),
                                                                           cmd );
        return new GridServiceDescriptionClient( gsd,
                                                 wpGsd,
View Full Code Here

        GridServiceDescription<WhitePages> wpGsd = getGsd();
        InetSocketAddress[] sockets = (InetSocketAddress[]) ((Address) wpGsd.getAddresses().get( "socket" )).getObject();
        CommandImpl cmd = new CommandImpl( "WhitePages.lookup",
                                           Arrays.asList( new Object[]{serviceDescriptionId} ) );
        ConversationManager convm = this.grid.get( ConversationManager.class );
        GridServiceDescription gsd = (GridServiceDescription) sendMessage( convm,
                                                                           sockets,
                                                                           wpGsd.getId(),
                                                                           cmd );
        return (gsd == null) ? gsd : new GridServiceDescriptionClient( gsd,
                                                                       wpGsd,
View Full Code Here

    }

    @Override
    public boolean equals(Object obj) {
        //@TODO: improve equals comparision
        final GridServiceDescription other = (GridServiceDescription) obj;
        if ( !this.getId().equals( other.getId() ) ) {
            return false;
        }
        return true;
    }
View Full Code Here

    WhitePages,
    MessageReceiverHandlerFactoryService {
    private Map<String, GridServiceDescription> directory = new ConcurrentHashMap<String, GridServiceDescription>();

    public GridServiceDescription create(String serviceDescriptionId) {
        GridServiceDescription gsd = new GridServiceDescriptionImpl(serviceDescriptionId);
        this.directory.put( gsd.getId(),
                            gsd );
        return gsd;
    }
View Full Code Here

    }

    @Override
    public boolean equals(Object obj) {
        //@TODO: improve equals comparision
        final GridServiceDescription other = (GridServiceDescription) obj;
        if ( !this.getId().equals( other.getId() ) ) {
            return false;
        }
        return true;
    }
View Full Code Here

    public GridNode createGridNode(String id) {
        if (logger.isDebugEnabled()) {
            logger.debug(" ### GridImpl: Registering in white pages (grid = " + getId() + ") new node = " + id);
        }
        WhitePages wp = get(WhitePages.class);
        GridServiceDescription gsd = wp.create(id );
        gsd.setServiceInterface(GridNode.class);
        GridNode node = new GridNodeImpl(id);
        this.localNodes.put(id , node);
        return node;
    }
View Full Code Here

    }

    public GridServiceDescription create( String serviceDescriptionId, String ownerGridId ) {
        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        GridServiceDescription gsd = new GridServiceDescriptionImpl( serviceDescriptionId, ownerGridId );
        em.persist( gsd );
        em.getTransaction().commit();
        em.close();
        return new GridServiceDescriptionJpa( gsd,
                                              emf );
View Full Code Here

                                              emf );
    }

    public GridServiceDescription lookup( String serviceDescriptionId ) {
        EntityManager em = this.emf.createEntityManager();
        GridServiceDescription gsd = em.find( GridServiceDescriptionImpl.class,
                                                                          serviceDescriptionId );
        em.close();
        return ( gsd == null ) ? null : new GridServiceDescriptionJpa( gsd,
                                                                       emf );
    }
View Full Code Here

        GridServiceDescription<WhitePages> wpGsd = getGsd();
        InetSocketAddress[] sockets = (InetSocketAddress[]) ((Address) wpGsd.getAddresses().get( "socket" )).getObject();
        CommandImpl cmd = new CommandImpl( "WhitePages.create",
                                           Arrays.asList( new Object[]{serviceDescriptionId, ownerId} ) );
        ConversationManager convm = this.grid.get( ConversationManager.class );
        GridServiceDescription gsd = (GridServiceDescription) sendMessage( convm,
                                                                           sockets,
                                                                           wpGsd.getId(),
                                                                           cmd );
        return new GridServiceDescriptionClient( gsd,
                                                 wpGsd,
View Full Code Here

TOP

Related Classes of org.drools.grid.GridServiceDescription

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.