Tabnine Logo
InvocationChain.getPhysicalOperation
Code IndexAdd Tabnine to your IDE (free)

How to use
getPhysicalOperation
method
in
org.fabric3.spi.container.wire.InvocationChain

Best Java code snippets using org.fabric3.spi.container.wire.InvocationChain.getPhysicalOperation (Showing top 20 results out of 315)

origin: com.carecon.fabric3/fabric3-binding-ws

/**
 * Constructor.
 *
 * @param chains Invocation chains.
 */
public JaxbInvoker(List<InvocationChain> chains) {
  for (InvocationChain chain : chains) {
    this.chains.put(chain.getPhysicalOperation().getName(), chain);
  }
}
origin: org.fabric3/fabric3-binding-ws-metro

/**
 * Constructor.
 *
 * @param chains Invocation chains.
 */
public JaxbInvoker(List<InvocationChain> chains) {
  for (InvocationChain chain : chains) {
    this.chains.put(chain.getPhysicalOperation().getName(), chain);
  }
}
origin: com.carecon.fabric3/fabric3-binding-zeromq

/**
 * Determines if the wire is one-way or request-reply. The first operation is used to determine if the contract is one-way as the binding does not support
 * mixing one-way and request-response operations on a service contract.
 *
 * @param chains the wire invocation chains
 * @param uri    thr service URI.
 * @return true if the wire is one-way
 */
private boolean isOneWay(List<InvocationChain> chains, URI uri) {
  if (chains.size() < 1) {
    throw new AssertionError("Contract must have at least one operation: " + uri);
  }
  return chains.get(0).getPhysicalOperation().isOneWay();
}
origin: com.carecon.fabric3/fabric3-binding-zeromq

/**
 * Returns the invocation chains for a wire in their natural order.
 *
 * @param wire the wire
 * @return the invocation chains
 */
public static List<InvocationChain> sortChains(Wire wire) {
  TreeMap<PhysicalOperation, InvocationChain> map = new TreeMap<>();
  for (InvocationChain chain : wire.getInvocationChains()) {
    map.put(chain.getPhysicalOperation(), chain);
  }
  List<InvocationChain> sorted = new ArrayList<>();
  sorted.addAll(map.values());
  return sorted;
}
origin: org.fabric3/fabric3-binding-ws-metro

/**
 * Constructor.
 *
 * @param chains the invocation chains for the wire.
 */
public DocumentInvoker(List<InvocationChain> chains) {
  for (InvocationChain chain : chains) {
    this.chains.put(chain.getPhysicalOperation().getName(), chain);
  }
  ClassLoader old = Thread.currentThread().getContextClassLoader();
  try {
    // set classloader to pick up correct SAAJ implementation
    Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
    factory = MessageFactory.newInstance();
  } catch (SOAPException e) {
    // programming error
    throw new AssertionError(e);
  } finally {
    Thread.currentThread().setContextClassLoader(old);
  }
}
origin: com.carecon.fabric3/fabric3-binding-ws

private void attachInterceptors(Class<?> seiClass, MetroJavaWireTarget target, Wire wire, Supplier<?> factory) {
  Method[] methods = seiClass.getMethods();
  int retries = target.getRetries();
  for (InvocationChain chain : wire.getInvocationChains()) {
    Method method = null;
    for (Method m : methods) {
      if (chain.getPhysicalOperation().getName().equals(m.getName())) {
        method = m;
        break;
      }
    }
    boolean oneWay = chain.getPhysicalOperation().isOneWay();
    MetroJavaTargetInterceptor targetInterceptor = new MetroJavaTargetInterceptor(factory, method, oneWay, retries, monitor);
    chain.addInterceptor(targetInterceptor);
  }
}
origin: org.fabric3/fabric3-binding-ws-metro

private void attachInterceptors(Class<?> seiClass, MetroJavaWireTargetDefinition target, Wire wire, ObjectFactory<?> factory) {
  Method[] methods = seiClass.getMethods();
  int retries = target.getRetries();
  for (InvocationChain chain : wire.getInvocationChains()) {
    Method method = null;
    for (Method m : methods) {
      if (chain.getPhysicalOperation().getName().equals(m.getName())) {
        method = m;
        break;
      }
    }
    boolean oneWay = chain.getPhysicalOperation().isOneWay();
    MetroJavaTargetInterceptor targetInterceptor = new MetroJavaTargetInterceptor(factory, method, oneWay, retries, monitor);
    chain.addInterceptor(targetInterceptor);
  }
}
origin: com.carecon.fabric3/fabric3-binding-jms

public ServiceListener(WireHolder wireHolder,
            Destination defaultResponseDestination,
            ConnectionFactory responseFactory,
            SessionType sessionType,
            ClassLoader classLoader,
            List<BindingHandler<Message>> handlers,
            ListenerMonitor monitor) {
  this.wireHolder = wireHolder;
  this.defaultResponseDestination = defaultResponseDestination;
  this.responseFactory = responseFactory;
  this.sessionType = sessionType;
  this.classLoader = classLoader;
  this.handlers = handlers;
  this.monitor = monitor;
  invocationChainMap = new HashMap<>();
  for (InvocationChainHolder chainHolder : wireHolder.getInvocationChains()) {
    String name = chainHolder.getChain().getPhysicalOperation().getName();
    if ("onMessage".equals(name)) {
      onMessageHolder = chainHolder;
    }
    invocationChainMap.put(name, chainHolder);
  }
}
origin: org.fabric3/fabric3-jdk-proxy

private Map<Method, InvocationChain> createInterfaceToWireMapping(Class<?> interfaze, Wire wire) {
  List<InvocationChain> invocationChains = wire.getInvocationChains();
  Map<Method, InvocationChain> chains = new HashMap<>(invocationChains.size());
  for (InvocationChain chain : invocationChains) {
    PhysicalOperation operation = chain.getPhysicalOperation();
    try {
      Method method = findMethod(interfaze, operation);
      chains.put(method, chain);
    } catch (NoSuchMethodException e) {
      throw new Fabric3Exception(operation.getName());
    } catch (ClassNotFoundException e) {
      throw new Fabric3Exception(e);
    }
  }
  return chains;
}
origin: com.carecon.fabric3/fabric3-jdk-proxy

private Map<Method, InvocationChain> createInterfaceToWireMapping(Class<?> interfaze, Wire wire) {
  List<InvocationChain> invocationChains = wire.getInvocationChains();
  Map<Method, InvocationChain> chains = new HashMap<>(invocationChains.size());
  for (InvocationChain chain : invocationChains) {
    PhysicalOperation operation = chain.getPhysicalOperation();
    try {
      Method method = findMethod(interfaze, operation);
      chains.put(method, chain);
    } catch (NoSuchMethodException e) {
      throw new Fabric3Exception(operation.getName());
    } catch (ClassNotFoundException e) {
      throw new Fabric3Exception(e);
    }
  }
  return chains;
}
origin: com.carecon.fabric3/fabric3-binding-zeromq

private void addTransformer(List<InvocationChain> chains, ClassLoader loader) throws Fabric3Exception {
  for (InvocationChain chain : chains) {
    PhysicalOperation physicalOperation = chain.getPhysicalOperation();
    List<DataType> targetTypes = createTypes(physicalOperation);
    Interceptor interceptor = interceptorFactory.createInterceptor(physicalOperation, TRANSPORT_TYPES, targetTypes, loader, loader);
    chain.addInterceptor(new WrappingInterceptor());
    chain.addInterceptor(interceptor);
  }
}
origin: com.carecon.fabric3/fabric3-binding-zeromq

public void connectToSender(String id, URI uri, List<InvocationChain> chains, ZeroMQMetadata metadata, ClassLoader loader) throws Fabric3Exception {
  SenderHolder holder;
  if (ZMQ.equals(uri.getScheme())) {
    DelegatingOneWaySender sender = new DelegatingOneWaySender(id, this, metadata);
    holder = new SenderHolder(sender);
  } else {
    holder = senders.get(uri.toString());
  }
  if (holder == null) {
    boolean oneWay = isOneWay(chains, uri);
    holder = createSender(uri.toString(), oneWay, metadata);
    managementService.registerSender(id, holder.getSender());
  }
  for (int i = 0, chainsSize = chains.size(); i < chainsSize; i++) {
    InvocationChain chain = chains.get(i);
    PhysicalOperation physicalOperation = chain.getPhysicalOperation();
    List<DataType> sourceTypes = createTypes(physicalOperation);
    Interceptor interceptor = interceptorFactory.createInterceptor(physicalOperation, sourceTypes, TRANSPORT_TYPES, loader, loader);
    chain.addInterceptor(interceptor);
    chain.addInterceptor(new UnwrappingInterceptor());
    interceptor = createInterceptor(holder, i);
    chain.addInterceptor(interceptor);
  }
  holder.getIds().add(id);
}
origin: com.carecon.fabric3/fabric3-system

public void attach(PhysicalWireSource source, SystemWireTarget target, Wire wire) throws Fabric3Exception {
  URI targetId = UriHelper.getDefragmentedName(target.getUri());
  SystemComponent targetComponent = (SystemComponent) manager.getComponent(targetId);
  Class<?> implementationClass = targetComponent.getImplementationClass();
  for (InvocationChain chain : wire.getInvocationChains()) {
    PhysicalOperation operation = chain.getPhysicalOperation();
    List<Class<?>> params = operation.getSourceParameterTypes();
    Method method;
    try {
      method = implementationClass.getMethod(operation.getName(), params.toArray(new Class[params.size()]));
    } catch (NoSuchMethodException e) {
      throw new Fabric3Exception("No matching method found", e);
    }
    SystemInvokerInterceptor interceptor = new SystemInvokerInterceptor(method, targetComponent);
    chain.addInterceptor(interceptor);
  }
}
origin: com.carecon.fabric3/fabric3-binding-jms

private WireHolder createWireHolder(Wire wire, JmsWireSource source, PhysicalWireTarget target) throws Fabric3Exception {
  JmsBindingMetadata metadata = source.getMetadata();
  List<OperationPayloadTypes> types = source.getPayloadTypes();
  CorrelationScheme correlationScheme = metadata.getCorrelationScheme();
  List<InvocationChainHolder> chainHolders = new ArrayList<>();
  for (InvocationChain chain : wire.getInvocationChains()) {
    PhysicalOperation physicalOperation = chain.getPhysicalOperation();
    OperationPayloadTypes payloadType = resolveOperation(physicalOperation.getName(), types);
    if (payloadType == null) {
      throw new Fabric3Exception("Payload type not found for operation: " + physicalOperation.getName());
    }
    if (source.getDataTypes().contains(PhysicalDataTypes.JAXB)) {
      addJAXBInterceptor(source, target, physicalOperation, chain);
    }
    chainHolders.add(new InvocationChainHolder(chain, payloadType));
  }
  return new WireHolder(chainHolders, correlationScheme);
}
origin: org.fabric3/fabric3-spring

public void attach(PhysicalWireSource source, SpringWireTarget target, Wire wire) throws Fabric3Exception {
  String beanName = target.getBeanName();
  ClassLoader loader = target.getClassLoader();
  Class<?> interfaze;
  try {
    interfaze = loader.loadClass(target.getBeanInterface());
  } catch (ClassNotFoundException e) {
    throw new Fabric3Exception(e);
  }
  for (WireListener listener : listeners) {
    listener.onAttach(wire);
  }
  SpringComponent component = getComponent(target);
  for (InvocationChain chain : wire.getInvocationChains()) {
    PhysicalOperation operation = chain.getPhysicalOperation();
    Method beanMethod = MethodUtils.findMethod(source, target, operation, interfaze, loader);
    SpringInvoker invoker = new SpringInvoker(beanName, beanMethod, component);
    chain.addInterceptor(invoker);
  }
}
origin: org.fabric3/fabric3-binding-rs-jersey

public void attach(PhysicalWireSource source, RsWireTarget target, Wire wire) throws Fabric3Exception {
  List<InvocationChain> invocationChains = wire.getInvocationChains();
  URI uri = target.getUri();
  Class<?> interfaceClass = target.getProxyInterface();
  try {
    for (InvocationChain chain : invocationChains) {
      PhysicalOperation operation = chain.getPhysicalOperation();
      String operationName = operation.getName();
      List<Class<?>> targetParameterTypes = operation.getTargetParameterTypes();
      chain.addInterceptor(new RsClientInterceptor(operationName, interfaceClass, uri, targetParameterTypes));
    }
  } catch (Exception e) {
    throw new Fabric3Exception(e);
  }
}
origin: com.carecon.fabric3/fabric3-binding-rs-jersey

public void attach(PhysicalWireSource source, RsWireTarget target, Wire wire) throws Fabric3Exception {
  List<InvocationChain> invocationChains = wire.getInvocationChains();
  URI uri = target.getUri();
  Class<?> interfaceClass = target.getProxyInterface();
  try {
    for (InvocationChain chain : invocationChains) {
      PhysicalOperation operation = chain.getPhysicalOperation();
      String operationName = operation.getName();
      List<Class<?>> targetParameterTypes = operation.getTargetParameterTypes();
      chain.addInterceptor(new RsClientInterceptor(operationName, interfaceClass, uri, targetParameterTypes));
    }
  } catch (Exception e) {
    throw new Fabric3Exception(e);
  }
}
origin: com.carecon.fabric3/fabric3-spring

public void attach(PhysicalWireSource source, SpringWireTarget target, Wire wire) throws Fabric3Exception {
  String beanName = target.getBeanName();
  ClassLoader loader = target.getClassLoader();
  Class<?> interfaze;
  try {
    interfaze = loader.loadClass(target.getBeanInterface());
  } catch (ClassNotFoundException e) {
    throw new Fabric3Exception(e);
  }
  for (WireListener listener : listeners) {
    listener.onAttach(wire);
  }
  SpringComponent component = getComponent(target);
  for (InvocationChain chain : wire.getInvocationChains()) {
    PhysicalOperation operation = chain.getPhysicalOperation();
    Method beanMethod = MethodUtils.findMethod(source, target, operation, interfaze, loader);
    SpringInvoker invoker = new SpringInvoker(beanName, beanMethod, component);
    chain.addInterceptor(invoker);
  }
}
origin: org.fabric3/fabric3-binding-ws-metro

public void attach(PhysicalWireSourceDefinition source, MetroWsdlWireTargetDefinition target, Wire wire) throws ContainerException {
  ReferenceEndpointDefinition endpointDefinition = target.getEndpointDefinition();
  List<QName> requestedIntents = target.getIntents();
  WebServiceFeature[] features = resolver.getFeatures(requestedIntents);
  String wsdl = target.getWsdl();
  URL wsdlLocation;
  try {
    URI servicePath = target.getEndpointDefinition().getUrl().toURI();
    wsdlLocation = cache.cache(servicePath, new ByteArrayInputStream(wsdl.getBytes()));
  } catch (CacheException | URISyntaxException e) {
    throw new ContainerException(e);
  }
  SecurityConfiguration securityConfiguration = target.getSecurityConfiguration();
  ConnectionConfiguration connectionConfiguration = target.getConnectionConfiguration();
  List<Handler> handlers = createHandlers(target);
  MetroDispatchObjectFactory proxyFactory = new MetroDispatchObjectFactory(endpointDefinition,
                                       wsdlLocation,
                                       null,
                                       securityConfiguration,
                                       connectionConfiguration,
                                       handlers,
                                       features,
                                       executorService,
                                       securityEnvironment);
  for (InvocationChain chain : wire.getInvocationChains()) {
    boolean oneWay = chain.getPhysicalOperation().isOneWay();
    MetroDispatchTargetInterceptor targetInterceptor = new MetroDispatchTargetInterceptor(proxyFactory, oneWay);
    chain.addInterceptor(targetInterceptor);
  }
}
origin: com.carecon.fabric3/fabric3-java

public void attach(PhysicalWireSource source, JavaWireTarget target, Wire wire) {
  URI targetName = UriHelper.getDefragmentedName(target.getUri());
  Component component = manager.getComponent(targetName);
  if (component == null) {
    throw new Fabric3Exception("Target not found: " + targetName);
  }
  JavaComponent javaComponent = (JavaComponent) component;
  Class<?> implementationClass = javaComponent.getImplementationClass();
  ClassLoader loader = target.getClassLoader();
  // attach the invoker interceptor to forward invocation chains
  for (InvocationChain chain : wire.getInvocationChains()) {
    PhysicalOperation operation = chain.getPhysicalOperation();
    Method method = MethodUtils.findMethod(source, target, operation, implementationClass, loader);
    ServiceInvoker invoker = reflectionFactory.createServiceInvoker(method);
    InvokerInterceptor interceptor;
    if (source instanceof PojoWireSource && target.getClassLoader().equals(source.getClassLoader())) {
      // if the source is Java and target classloaders are equal, do not set the TCCL
      interceptor = new InvokerInterceptor(invoker, javaComponent);
    } else {
      // If the source and target classloaders are not equal, configure the interceptor to set the TCCL to the target classloader
      // when dispatching to a target instance. This guarantees when application code executes, it does so with the TCCL set to the
      // target component's classloader.
      interceptor = new InvokerInterceptor(invoker, javaComponent, loader);
    }
    chain.addInterceptor(interceptor);
  }
}
org.fabric3.spi.container.wireInvocationChaingetPhysicalOperation

Javadoc

Returns the target physical operation for this invocation chain.

Popular methods of InvocationChain

  • addInterceptor
    Adds an interceptor to the chain
  • getHeadInterceptor
    Returns the first interceptor in the chain.

Popular in Java

  • Reading from database using SQL prepared statement
  • compareTo (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • runOnUiThread (Activity)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now