/** * Set the Remoting Connection on the RemotingContext. * * @param connection - The Remoting connection. */ static void remotingContextSetConnection(final RemoteConnection connection) { remoteContextAssociationActions().setConnection(connection); }
/** * Clear the Remoting Connection on the RemotingContext. */ static void remotingContextClear() { remotingContextAssociationActions().clear(); }
/** * Set the Remoting Connection on the RemotingContext. * * @param connection - The Remoting connection. */ static void remotingContextSetConnection(final Connection connection) { remotingContextAssociationActions().setConnection(connection); }
/** * {@inheritDoc} */ public void getResourceValue(final ResolutionContext resolutionContext, final ServiceBuilder<?> serviceBuilder, final DeploymentPhaseContext phaseContext, final Injector<ManagedReferenceFactory> injector) { if(serviceName != null) { serviceBuilder.requires(serviceName); } final RemoteViewManagedReferenceFactory factory = new RemoteViewManagedReferenceFactory(appName, moduleName, distinctName, beanName, viewClass, stateful, viewClassLoader, appclient); injector.inject(factory); }
static Object clone(final Class<?> target, final ObjectCloner cloner, final Object object, final boolean allowPassByReference) { if (object == null) { return null; } // don't clone primitives if (target.isPrimitive()) { return object; } if (allowPassByReference && target.isAssignableFrom(object.getClass())) { return object; } return clone(cloner, object); }
public Class<?> cloneProxy(final Class<?> proxyClass) throws IOException, ClassNotFoundException { final Class<?>[] origInterfaces = proxyClass.getInterfaces(); final Class<?>[] interfaces = new Class[origInterfaces.length]; for (int i = 0, origInterfacesLength = origInterfaces.length; i < origInterfacesLength; i++) { interfaces[i] = clone(origInterfaces[i]); } return Proxy.getProxyClass(destClassLoader, interfaces); } }
@Override public void start(StartContext startContext) throws StartException { receiver = new LocalEjbReceiver(allowPassByReference, deploymentRepository.getValue()); }
public void inject(final AssociationService value) throws InjectionException { providerInjector.inject(value.getLocalDiscoveryProvider()); }
@Override public String getJndiViewInstanceValue() { return stateful ? JndiViewManagedReferenceFactory.DEFAULT_JNDI_VIEW_INSTANCE_VALUE : String.valueOf(getReference() .getInstance()); }
AssociationImpl(final DeploymentRepository deploymentRepository, final Registry<String, List<ClientMapping>> clientMappingRegistry) { this.deploymentRepository = deploymentRepository; this.clientMappingRegistry = clientMappingRegistry; this.clusterTopologyRegistrar = (clientMappingRegistry != null) ? new ClusterTopologyRegistrar(clientMappingRegistry) : null; }
void setExecutor(Executor executor) { if(value != null) { value.setExecutor(executor); } } }
@Override public void updatedEntries(Map<String, List<ClientMapping>> updated) { this.addedEntries(updated); }
@Override public void close() { if (this.clusterTopologyRegistrar != null) this.clusterTopologyRegistrar.close(); }
@Override public void addedEntries(Map<String, List<ClientMapping>> added) { ClusterTopologyListener.ClusterInfo info = getClusterInfo(added); for (ClusterTopologyListener listener : this.clusterTopologyListeners) {// Synchronize each listener to ensure that the initial topology was set before processing new entries synchronized (listener) { listener.clusterNewNodesAdded(info); } } }
@Override public ListenerHandle registerClusterTopologyListener(@NotNull final ClusterTopologyListener clusterTopologyListener) { return (this.clusterTopologyRegistrar != null) ? this.clusterTopologyRegistrar.registerClusterTopologyListener(clusterTopologyListener) : () -> {}; }
private static Affinity getWeakAffinity(final StatefulSessionComponent statefulSessionComponent, final StatefulEJBLocator<?> statefulEJBLocator) { final SessionID sessionID = statefulEJBLocator.getSessionId(); return getWeakAffinity(statefulSessionComponent, sessionID); }
public void inject(final RemotingProfileService value) throws InjectionException { final EJBTransportProvider provider = value.getLocalTransportProviderInjector().getOptionalValue(); if (provider != null) { injected = true; injector.inject(provider); } }
@Override public void stop(StopContext context) { associationServiceInjectedValue.getValue().setExecutor(null); registration.close(); }
public void inject(final RemotingProfileService value) throws InjectionException { providerInjector.inject(new StaticDiscoveryProvider(value.getServiceUrls())); }
public Object getResult() throws Exception { return LocalEjbReceiver.clone(invocation.getInvokedMethod().getReturnType(), resultCloner, result, allowPassByReference); }