public EJBReceiver getReceiver(final EJBReceiverContext receiverContext, final String uriScheme) throws IllegalArgumentException { switch (uriScheme) { case "remote": case "remote+http": case "remote+https": // compatibility case "remoting": case "http-remoting": case "https-remoting": { final RemoteEJBReceiver receiver = receiverContext.getClientContext().getAttachment(ATTACHMENT_KEY); if (receiver != null) { return receiver; } // else fall through } default: { throw new IllegalArgumentException("Unsupported EJB receiver protocol " + uriScheme); } } } }
receiverContext = new EJBReceiverContext(this); final List<EJBClientConnection> clientConnections = builder.clientConnections; if (clientConnections == null || clientConnections.isEmpty()) {
@Override public void stop(final StopContext context) { for (EJBReceiverContext ctx : contexts) { ctx.close(); } this.contexts.clear(); deploymentRepository.getValue().removeListener(deploymentListener); // remove ourselves from cluster creation/removal event notifications @SuppressWarnings("unchecked") RegistryCollector<String, List<ClientMapping>> collector = this.clusterRegistryCollector.getValue(); collector.removeListener(this); // we no longer are interested in cluster topology updates, so unregister the update listener for (final ClusterTopologyUpdateListener clusterTopologyUpdateListener : this.clusterTopologyUpdateListeners) { clusterTopologyUpdateListener.unregisterListener(); } }
@Override public EJBReceiver getReceiver(EJBReceiverContext ejbReceiverContext, String s) throws IllegalArgumentException { if(PROTOCOLS.contains(s)) { HttpEJBReceiver receiver = ejbReceiverContext.getClientContext().getAttachment(RECEIVER); if(receiver != null) { return receiver; } } throw EjbHttpClientMessages.MESSAGES.couldNotCreateHttpEjbReceiverFor(s); }
receiverContext = new EJBReceiverContext(this); final List<EJBClientConnection> clientConnections = builder.clientConnections; if (clientConnections == null || clientConnections.isEmpty()) {
@Override public void notifyRegistered(EJBReceiverContext receiverContext) { receiverContext.getClientContext().putAttachment(RECEIVER, new HttpEJBReceiver()); }
receiverContext = new EJBReceiverContext(this); final List<EJBClientConnection> clientConnections = builder.clientConnections; if (clientConnections == null || clientConnections.isEmpty()) {
public void notifyRegistered(final EJBReceiverContext receiverContext) { final EJBClientContext clientContext = receiverContext.getClientContext(); clientContext.putAttachmentIfAbsent(ATTACHMENT_KEY, new RemoteEJBReceiver(this, receiverContext, new RemotingEJBDiscoveryProvider())); }
for (EJBClientConnection connection : ejbReceiver.getReceiverContext().getClientContext().getConfiguredConnections()) { if (connection.isForDiscovery()) { everything.add(connection.getDestination());
private void addClusterNodes(final String clusterName, final Map<String, List<ClientMapping>> addedNodes) { if (addedNodes == null || addedNodes.isEmpty()) { return; } final List<EJBReceiverContext> receiverContexts = this.contexts; for (final EJBReceiverContext receiverContext : receiverContexts) { this.addClusterNodes(receiverContext.getClientContext(), clusterName, addedNodes); } }
public EJBReceiver getReceiver(final EJBReceiverContext receiverContext, final String uriScheme) throws IllegalArgumentException { switch (uriScheme) { case "remote": case "remote+http": case "remote+https": // compatibility case "remoting": case "http-remoting": case "https-remoting": { final RemoteEJBReceiver receiver = receiverContext.getClientContext().getAttachment(ATTACHMENT_KEY); if (receiver != null) { return receiver; } // else fall through } default: { throw new IllegalArgumentException("Unsupported EJB receiver protocol " + uriScheme); } } } }
public EJBReceiver getReceiver(final EJBReceiverContext receiverContext, final String uriScheme) throws IllegalArgumentException { switch (uriScheme) { case "remote": case "remote+http": case "remote+https": // compatibility case "remoting": case "http-remoting": case "https-remoting": { final RemoteEJBReceiver receiver = receiverContext.getClientContext().getAttachment(ATTACHMENT_KEY); if (receiver != null) { return receiver; } // else fall through } default: { throw new IllegalArgumentException("Unsupported EJB receiver protocol " + uriScheme); } } } }
@Override public EJBReceiver getReceiver(EJBReceiverContext ejbReceiverContext, String s) throws IllegalArgumentException { if(PROTOCOLS.contains(s)) { HttpEJBReceiver receiver = ejbReceiverContext.getClientContext().getAttachment(RECEIVER); if(receiver != null) { return receiver; } } throw EjbHttpClientMessages.MESSAGES.couldNotCreateHttpEjbReceiverFor(s); }
@Override public EJBReceiver getReceiver(EJBReceiverContext ejbReceiverContext, String s) throws IllegalArgumentException { if(PROTOCOLS.contains(s)) { HttpEJBReceiver receiver = ejbReceiverContext.getClientContext().getAttachment(RECEIVER); if(receiver != null) { return receiver; } } throw EjbHttpClientMessages.MESSAGES.couldNotCreateHttpEjbReceiverFor(s); }
@Override public void notifyRegistered(EJBReceiverContext receiverContext) { receiverContext.getClientContext().putAttachment(RECEIVER, new HttpEJBReceiver()); }
@Override public void notifyRegistered(EJBReceiverContext receiverContext) { receiverContext.getClientContext().putAttachment(RECEIVER, new HttpEJBReceiver()); }
@Override public void removedEntries(Set<String> removedNodes) { final List<EJBReceiverContext> receiverContexts = LocalEjbReceiver.this.contexts; for (final EJBReceiverContext receiverContext : receiverContexts) { final ClusterContext clusterContext = receiverContext.getClientContext().getClusterContext(this.cluster.getName()); if (clusterContext == null) { continue; } // remove the nodes from the cluster context for (final String removedNodeName : removedNodes) { clusterContext.removeClusterNode(removedNodeName); } } }
@Override protected void associate(final EJBReceiverContext receiverContext) { this.contexts.add(receiverContext); final RegistryCollector<String, List<ClientMapping>> clusters = this.clusterRegistryCollector.getOptionalValue(); if (clusters == null) { return; } // for each cluster update the EJB client context with the current nodes in the cluster for (final Registry<String, List<ClientMapping>> cluster : clusters.getRegistries()) { this.addClusterNodes(receiverContext.getClientContext(), cluster.getName(), cluster.getEntries()); } }
public void notifyRegistered(final EJBReceiverContext receiverContext) { final EJBClientContext clientContext = receiverContext.getClientContext(); clientContext.putAttachmentIfAbsent(ATTACHMENT_KEY, new RemoteEJBReceiver(this, receiverContext, new RemotingEJBDiscoveryProvider())); }
public void notifyRegistered(final EJBReceiverContext receiverContext) { final EJBClientContext clientContext = receiverContext.getClientContext(); clientContext.putAttachmentIfAbsent(ATTACHMENT_KEY, new RemoteEJBReceiver(this, receiverContext, new RemotingEJBDiscoveryProvider())); }