Search in sources :

Example 1 with ClusteredRPCContainer

use of org.apache.openejb.ClusteredRPCContainer in project tomee by apache.

the class BasicClusterableRequestHandler method updateServer.

@Override
public void updateServer(final BeanContext beanContext, final ClusterableRequest req, final ClusterableResponse res) {
    final Container container = beanContext.getContainer();
    if (container instanceof ClusteredRPCContainer) {
        final ClusteredRPCContainer clusteredContainer = (ClusteredRPCContainer) container;
        final URI[] locations = clusteredContainer.getLocations(beanContext);
        if (null != locations) {
            final ServerMetaData server = new ServerMetaData(locations);
            if (req.getServerHash() != server.buildHash()) {
                res.setServer(server);
            }
        }
    }
}
Also used : ClusteredRPCContainer(org.apache.openejb.ClusteredRPCContainer) Container(org.apache.openejb.Container) URI(java.net.URI) ServerMetaData(org.apache.openejb.client.ServerMetaData) ClusteredRPCContainer(org.apache.openejb.ClusteredRPCContainer)

Aggregations

URI (java.net.URI)1 ClusteredRPCContainer (org.apache.openejb.ClusteredRPCContainer)1 Container (org.apache.openejb.Container)1 ServerMetaData (org.apache.openejb.client.ServerMetaData)1