org.distributeme.test.combined.generated.RemoteAdminServiceStub Maven / Gradle / Ivy
package org.distributeme.test.combined.generated;
//BEGIN GENERATED CODE
import java.util.List;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentHashMap;
import org.slf4j.Logger;
import java.rmi.RemoteException;
import java.rmi.NotBoundException;
import org.distributeme.core.RegistryUtil;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import org.distributeme.core.ServiceDescriptor;
import org.distributeme.core.ServiceDescriptor.Protocol;
import org.distributeme.core.DiscoveryMode;
import org.distributeme.core.failing.FailingStrategy;
import org.distributeme.core.concurrencycontrol.ConcurrencyControlStrategy;
import org.distributeme.core.failing.FailDecision;
import org.distributeme.core.ClientSideCallContext;
import org.distributeme.core.exception.DistributemeRuntimeException;
import org.distributeme.core.exception.NoConnectionToServerException;
import org.distributeme.core.exception.ServiceUnavailableException;
import org.distributeme.core.Defaults;
import org.distributeme.core.interceptor.ClientSideRequestInterceptor;
import org.distributeme.core.interceptor.InterceptorRegistry;
import org.distributeme.core.interceptor.InterceptorResponse;
import org.distributeme.core.interceptor.InterceptionContext;
import org.distributeme.core.interceptor.InterceptionPhase;
import org.distributeme.core.interceptor.FailedByInterceptorException;
@SuppressWarnings("PMD")
public class RemoteAdminServiceStub implements org.distributeme.test.combined.AdminService{
private volatile ConcurrentMap delegates = new ConcurrentHashMap();
private DiscoveryMode discoveryMode = DiscoveryMode.AUTO;
// ROUTER DECL V2
// No class-wide-router set, skipping.
// Method wide routers if applicable
// Method wide routers END
// ROUTER DECL V2 end
// Failing
// Class wide failing strategy
private FailingStrategy clazzWideFailingStrategy = Defaults.getDefaultFailingStrategy();
private FailingStrategy adminMethodFailingStrategy = clazzWideFailingStrategy;
// Failing end
// CONCURRENCY CONTROL
// Class wide concurrency control strategy
private ConcurrencyControlStrategy clazzWideCCStrategy = Defaults.getDefaultConcurrencyControlStrategy();
private ConcurrencyControlStrategy adminMethodCCStrategy = clazzWideCCStrategy;
// CONCURRENCY CONTROL end
public RemoteAdminServiceStub(){
discoveryMode = DiscoveryMode.AUTO;
}
private ServiceDescriptor manuallySetDescriptor;
private RemoteAdminService manuallySetTarget;
public RemoteAdminServiceStub(ServiceDescriptor target){
discoveryMode = DiscoveryMode.MANUAL;
manuallySetDescriptor = target;
try{
manuallySetTarget = lookup(manuallySetDescriptor);
}catch(NoConnectionToServerException e){
throw new IllegalStateException("Can not resolve manually set reference", e);
}
}
public void adminMethod() throws org.distributeme.test.combined.AdminServiceException{
adminMethod((ClientSideCallContext)null);
} //...public void adminMethod() throws org.distributeme.test.combined.AdminServiceException
private void adminMethod(org.distributeme.core.ClientSideCallContext diMeCallContext) throws org.distributeme.test.combined.AdminServiceException{
List __fromServerSide = null;
Exception exceptionInMethod = null;
// This flag is used by the interceptor logic to mark a request es failed, even it is not.
boolean diMeForceFailing = false;
boolean abortAndFail = false;
if (diMeCallContext == null)
diMeCallContext = new ClientSideCallContext("adminMethod");
if (discoveryMode == DiscoveryMode.MANUAL) {
diMeCallContext.setServiceId(manuallySetDescriptor.getServiceId());
}
if (discoveryMode==DiscoveryMode.AUTO && diMeCallContext.getServiceId()==null)
diMeCallContext.setServiceId(AdminServiceConstants.getServiceId());
HashMap __transportableCallContext = diMeCallContext.getTransportableCallContext();
// Initialize interceptors
List diMeInterceptors = InterceptorRegistry.getInstance().getClientSideRequestInterceptors();
InterceptionContext diMeInterceptionContext = new InterceptionContext();
// Concurrency control, client side - start
adminMethodCCStrategy.notifyClientSideCallStarted(diMeCallContext);
try{
ArrayList
© 2015 - 2025 Weber Informatics LLC | Privacy Policy