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

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

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

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: org.fabric3/fabric3-binding-ftp

  private Interceptor getInterceptor() {
    // lazy load the interceptor as it may not have been added when the instance was created in the wire attacher
    if (interceptor == null) {
      interceptor = wire.getInvocationChains().iterator().next().getHeadInterceptor();
    }
    return interceptor;
  }
}
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: com.carecon.fabric3/fabric3-binding-jms

private void addJAXBInterceptor(PhysicalWireSource source, PhysicalOperation op, InvocationChain chain, ClassLoader targetClassLoader) {
  ClassLoader sourceClassLoader = source.getClassLoader();
  List<DataType> jaxTypes = DataTypeHelper.createTypes(op);
  Interceptor jaxbInterceptor = interceptorFactory.createInterceptor(op, jaxTypes, DataTypeHelper.JAXB_TYPES, targetClassLoader, sourceClassLoader);
  chain.addInterceptor(jaxbInterceptor);
}
origin: com.carecon.fabric3/fabric3-binding-jms

Interceptor interceptor = holder.getChain().getHeadInterceptor();
boolean oneWay = holder.getChain().getPhysicalOperation().isOneWay();
OperationPayloadTypes payloadTypes = holder.getPayloadTypes();
PayloadType inputType = payloadTypes.getInputType();
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-file

public void attach(PhysicalWireSource source, FileBindingWireTarget target, Wire wire) throws Fabric3Exception {
  File location = resolve(target.getLocation());
  location.mkdirs();
  ReferenceAdapter adapter = getAdaptor(target);
  FileSystemInterceptor interceptor = new FileSystemInterceptor(location, adapter);
  for (InvocationChain chain : wire.getInvocationChains()) {
    chain.addInterceptor(interceptor);
  }
}
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: 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-jms

private void addJAXBInterceptor(JmsWireSource source, PhysicalWireTarget target, PhysicalOperation op, InvocationChain chain) {
  ClassLoader sourceClassLoader = source.getClassLoader();
  ClassLoader targetClassLoader = target.getClassLoader();
  List<DataType> jaxTypes = DataTypeHelper.createTypes(op);
  Interceptor jaxbInterceptor = interceptorFactory.createInterceptor(op, DataTypeHelper.JAXB_TYPES, jaxTypes, targetClassLoader, sourceClassLoader);
  chain.addInterceptor(jaxbInterceptor);
}
origin: com.carecon.fabric3/fabric3-binding-zeromq

/**
 * Constructor.
 *
 * @param manager         the ZeroMQ Context manager
 * @param address         the address to receive messages on
 * @param chains          the invocation chains for dispatching invocations
 * @param socketType      the socket type as defined by ZeroMQ
 * @param metadata        metadata
 * @param executorService the executor for scheduling work
 * @param monitor         the monitor
 */
public AbstractReceiver(ContextManager manager,
            SocketAddress address,
            List<InvocationChain> chains,
            int socketType,
            ZeroMQMetadata metadata,
            ExecutorService executorService,
            MessagingMonitor monitor) {
  this.manager = manager;
  this.address = address;
  this.executorService = executorService;
  this.interceptors = new Interceptor[chains.size()];
  for (int i = 0, chainsSize = chains.size(); i < chainsSize; i++) {
    InvocationChain chain = chains.get(i);
    interceptors[i] = chain.getHeadInterceptor();
  }
  this.socketType = socketType;
  this.metadata = metadata;
  this.monitor = monitor;
}
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-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: com.carecon.fabric3/fabric3-fabric

Wire createWire(PhysicalWire physicalWire) throws Fabric3Exception {
  Wire wire = new WireImpl();
  for (PhysicalOperation operation : physicalWire.getOperations()) {
    InvocationChain chain = new InvocationChainImpl(operation);
    for (PhysicalInterceptor physicalInterceptor : operation.getInterceptors()) {
      InterceptorBuilder<? super PhysicalInterceptor> builder = Cast.cast(interceptorBuilders.get(physicalInterceptor.getClass()));
      Interceptor interceptor = builder.build(physicalInterceptor);
      chain.addInterceptor(interceptor);
    }
    wire.addInvocationChain(chain);
  }
  return wire;
}
origin: org.fabric3/fabric3-binding-ws-metro

public Object invoke(Packet packet, Method method, Object... args) throws InvocationTargetException {
  // the work context is populated by the current tubeline
  WorkContext workContext = (WorkContext) packet.invocationProperties.get(MetroConstants.WORK_CONTEXT);
  if (workContext == null) {
    // programming error
    throw new AssertionError("Work context not set");
  }
  Message input = MessageCache.getAndResetMessage();
  try {
    input.setWorkContext(workContext);
    input.setBody(args);
    Interceptor head = chains.get(method.getName()).getHeadInterceptor();
    Message ret = head.invoke(input);
    if (!ret.isFault()) {
      return ret.getBody();
    } else {
      Throwable th = (Throwable) ret.getBody();
      throw new InvocationTargetException(th);
    }
  } finally {
    input.reset();
  }
}
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: 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: org.fabric3/fabric3-fabric

Wire createWire(PhysicalWire physicalWire) throws Fabric3Exception {
  Wire wire = new WireImpl();
  for (PhysicalOperation operation : physicalWire.getOperations()) {
    InvocationChain chain = new InvocationChainImpl(operation);
    for (PhysicalInterceptor physicalInterceptor : operation.getInterceptors()) {
      InterceptorBuilder<? super PhysicalInterceptor> builder = Cast.cast(interceptorBuilders.get(physicalInterceptor.getClass()));
      Interceptor interceptor = builder.build(physicalInterceptor);
      chain.addInterceptor(interceptor);
    }
    wire.addInvocationChain(chain);
  }
  return wire;
}
origin: com.carecon.fabric3/fabric3-binding-ws

public Object invoke(Packet packet, Method method, Object... args) throws InvocationTargetException {
  // the work context is populated by the current tubeline
  WorkContext workContext = (WorkContext) packet.invocationProperties.get(MetroConstants.WORK_CONTEXT);
  if (workContext == null) {
    // programming error
    throw new AssertionError("Work context not set");
  }
  Message input = MessageCache.getAndResetMessage();
  try {
    input.setWorkContext(workContext);
    input.setBody(args);
    Interceptor head = chains.get(method.getName()).getHeadInterceptor();
    Message ret = head.invoke(input);
    if (!ret.isFault()) {
      return ret.getBody();
    } else {
      Throwable th = (Throwable) ret.getBody();
      throw new InvocationTargetException(th);
    }
  } finally {
    input.reset();
  }
}
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);
  }
}
org.fabric3.spi.container.wireInvocationChain

Javadoc

A wire consists of 1..n invocation chains associated with the operations of its source service contract. Invocation chains contain Interceptors that process invocations in an around-style manner.

Most used methods

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

Popular in Java

  • Reactive rest calls using spring rest template
  • getContentResolver (Context)
  • requestLocationUpdates (LocationManager)
  • runOnUiThread (Activity)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Path (java.nio.file)
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • JFrame (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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