Add JavaDocs

This commit is contained in:
Konstantin Krivopustov 2017-12-07 15:00:03 +04:00
parent 8db1e5f599
commit aba7b72a3d
6 changed files with 37 additions and 2 deletions

View File

@ -34,6 +34,12 @@ import java.lang.reflect.Parameter;
import java.lang.reflect.Proxy;
import java.util.UUID;
/**
* INTERNAL.
* <p>
* Bean of the web block that creates a proxy object to invoke middleware services directly
* using {@link LocalServiceInvoker}.
*/
public class LocalServiceProxy extends RemoteAccessor implements FactoryBean<Object>, InitializingBean {
private Object serviceProxy;
@ -146,7 +152,7 @@ public class LocalServiceProxy extends RemoteAccessor implements FactoryBean<Obj
invocation.setResultBypassSerialization(canMethodResultBypassSerialization(method));
LocalServiceInvocationResult result = invoker.invoke(invocation);
AppContext.setSecurityContext(AppContext.getSecurityContext());//need reset application name in LogMDC for the current thread
AppContext.setSecurityContext(AppContext.getSecurityContext());// to reset application name in LogMDC for the current thread
// don't use SerializationUtils.deserialize() here to avoid ClassNotFoundException
if (result.getException() != null) {

View File

@ -25,6 +25,12 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
/**
* INTERNAL.
* <p>
* This class holds a collection of {@link LocalServiceInvoker} instances. It must be loaded to a classloader shared
* between the client tier and middleware.
*/
public class LocalServiceDirectory {
private static Map<String, LocalServiceInvoker> invokers = new ConcurrentHashMap<>();

View File

@ -20,6 +20,11 @@ package com.haulmont.cuba.core.sys.remoting;
import java.util.TimeZone;
import java.util.UUID;
/**
* INTERNAL.
* <p>
* An object that is passed when invoking middleware services using {@link LocalServiceInvoker}.
*/
public class LocalServiceInvocation {
private String methodName;
private String[] parameterTypeNames;

View File

@ -17,6 +17,11 @@
package com.haulmont.cuba.core.sys.remoting;
/**
* INTERNAL.
* <p>
* A result object that is returned to the client when invoking middleware services using {@link LocalServiceInvoker}.
*/
public class LocalServiceInvocationResult {
private byte[] data;

View File

@ -17,6 +17,13 @@
package com.haulmont.cuba.core.sys.remoting;
/**
* INTERNAL.
* <p>
* Enables direct invocation of middleware services from the client tier.
* Implementation objects are created on the middleware side and registered in {@link LocalServiceDirectory},
* which is available both to the client and middle tier.
*/
public interface LocalServiceInvoker {
LocalServiceInvocationResult invoke(LocalServiceInvocation invocation);

View File

@ -34,6 +34,12 @@ import java.lang.reflect.Parameter;
import java.lang.reflect.Proxy;
import java.util.UUID;
/**
* INTERNAL.
* <p>
* Bean of the web block that creates a proxy object to invoke middleware services directly
* using {@link LocalServiceInvoker}.
*/
public class LocalServiceProxy extends RemoteAccessor implements FactoryBean<Object>, InitializingBean {
private Object serviceProxy;
@ -146,7 +152,7 @@ public class LocalServiceProxy extends RemoteAccessor implements FactoryBean<Obj
invocation.setResultBypassSerialization(canMethodResultBypassSerialization(method));
LocalServiceInvocationResult result = invoker.invoke(invocation);
AppContext.setSecurityContext(AppContext.getSecurityContext());//need reset application name in LogMDC for the current thread
AppContext.setSecurityContext(AppContext.getSecurityContext()); // to reset application name in LogMDC for the current thread
// don't use SerializationUtils.deserialize() here to avoid ClassNotFoundException
if (result.getException() != null) {