gpt4 book ai didi

org.fabric3.spi.wire.Wire类的使用及代码示例

转载 作者:知者 更新时间:2024-03-27 11:35:05 26 4
gpt4 key购买 nike

本文整理了Java中org.fabric3.spi.wire.Wire类的一些代码示例,展示了Wire类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Wire类的具体详情如下:
包路径:org.fabric3.spi.wire.Wire
类名称:Wire

Wire介绍

暂无

代码示例

代码示例来源:origin: org.codehaus.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: org.codehaus.fabric3/fabric3-fabric

Wire createWire(PhysicalWireDefinition definition) throws BuilderException {
  Wire wire = new WireImpl();
  for (PhysicalOperationDefinition operation : definition.getOperations()) {
    InvocationChain chain = new InvocationChainImpl(operation);
    for (PhysicalInterceptorDefinition interceptorDefinition : operation.getInterceptors()) {
      InterceptorBuilder<? super PhysicalInterceptorDefinition> builder = getBuilder(interceptorDefinition);
      Interceptor interceptor = builder.build(interceptorDefinition);
      chain.addInterceptor(interceptor);
    }
    wire.addInvocationChain(chain);
  }
  processTransform(wire, definition);
  return wire;
}

代码示例来源:origin: org.codehaus.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<PhysicalOperationDefinition, InvocationChain> map = new TreeMap<PhysicalOperationDefinition, InvocationChain>();
  for (InvocationChain chain : wire.getInvocationChains()) {
    map.put(chain.getPhysicalOperation(), chain);
  }
  List<InvocationChain> sorted = new ArrayList<InvocationChain>();
  sorted.addAll(map.values());
  return sorted;
}

代码示例来源:origin: org.codehaus.fabric3/fabric3-spring-security

public void onAttach(Wire wire) {
    for (InvocationChain chain : wire.getInvocationChains()) {
      SecurityContextInterceptor interceptor = new SecurityContextInterceptor();
      chain.addInterceptor(interceptor);
    }
  }
}

代码示例来源:origin: org.codehaus.fabric3/fabric3-binding-rs-jersey

private void provision(RsSourceDefinition sourceDefinition, Wire wire, RsContainer container) throws ClassNotFoundException, RsContainerException {
  ClassLoader classLoader = classLoaderRegistry.getClassLoader(sourceDefinition.getClassLoaderId());
  Map<String, InvocationChain> invocationChains = new HashMap<String, InvocationChain>();
  for (InvocationChain chain : wire.getInvocationChains()) {
    PhysicalOperationDefinition operation = chain.getPhysicalOperation();
    invocationChains.put(operation.getName(), chain);
  }
  Class<?> interfaze = classLoader.loadClass(sourceDefinition.getRsClass());
  boolean authenticate = authenticate(sourceDefinition);
  F3ResourceHandler handler = new F3ResourceHandler(interfaze, invocationChains, authenticate, authenticator);
  // Set the class loader to the runtime one so Jersey loads the Resource config properly
  ClassLoader old = Thread.currentThread().getContextClassLoader();
  try {
    Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
    Resource resource = createResource(handler);
    container.addResource(resource);
  } finally {
    Thread.currentThread().setContextClassLoader(old);
  }
}

代码示例来源:origin: org.codehaus.fabric3/fabric3-binding-ws-axis2

private void setMessageReceivers(Wire wire, AxisService axisService) throws Exception {
  Map<String, InvocationChain> interceptors = new HashMap<String, InvocationChain>();
  for (InvocationChain chain : wire.getInvocationChains()) {
    interceptors.put(chain.getPhysicalOperation().getName(), chain);
  }
  Utils.fillAxisService(axisService, configurationContext.getAxisConfiguration(), null, null);
  for (Iterator<?> i = axisService.getOperations(); i.hasNext();) {
    AxisOperation axisOp = (AxisOperation) i.next();
    InvocationChain invocationChain = interceptors.get(axisOp.getName().getLocalPart());
    MessageReceiver messageReceiver = null;
    if (WSDL2Constants.MEP_URI_IN_ONLY.equals(axisOp.getMessageExchangePattern()) ||
        WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(axisOp.getMessageExchangePattern())) {
      messageReceiver = new InOnlyServiceProxyHandler(invocationChain);
    } else {//Default MEP is IN-OUT for backward compatibility
      messageReceiver = new InOutServiceProxyHandler(invocationChain);
    }
    axisOp.setMessageReceiver(messageReceiver);
  }
}

代码示例来源:origin: org.codehaus.fabric3/fabric3-binding-ftp

public void attach(PhysicalSourceDefinition source, FtpTargetDefinition target, Wire wire) throws WiringException {
  InvocationChain invocationChain = wire.getInvocationChains().iterator().next();
  URI uri = target.getUri();
  try {
    String host = uri.getHost();
    int port = uri.getPort() == -1 ? 23 : uri.getPort();
    InetAddress hostAddress = "localhost".equals(host) ? InetAddress.getLocalHost() : InetAddress.getByName(host);
    String remotePath = uri.getPath();
    String tmpFileSuffix = target.getTmpFileSuffix();
    FtpSecurity security = target.getSecurity();
    boolean active = target.isActive();
    int connectTimeout = target.getConectTimeout();
    SocketFactory factory = new ExpiringSocketFactory(connectTimeout);
    int socketTimeout = target.getSocketTimeout();
    List<String> cmds = target.getSTORCommands();
    FtpTargetInterceptor targetInterceptor =
        new FtpTargetInterceptor(hostAddress, port, security, active, socketTimeout, factory, cmds, monitor);
    targetInterceptor.setTmpFileSuffix(tmpFileSuffix);
    targetInterceptor.setRemotePath(remotePath);
    invocationChain.addInterceptor(targetInterceptor);
  } catch (UnknownHostException e) {
    throw new WiringException(e);
  }
}

代码示例来源:origin: org.codehaus.fabric3/fabric3-binding-ws-axis2

public void attachToTarget(PhysicalWireSourceDefinition source, Axis2WireTargetDefinition target, Wire wire) throws WiringException {
  ClassLoader classLoader = classLoaderRegistry.getClassLoader(source.getClassLoaderId());
  List<String> endpointUris = new LinkedList<String>();
  String endpointUri = expandUri(target.getUri());
  StringTokenizer tok = new StringTokenizer(endpointUri);
  while (tok.hasMoreElements()) {
    endpointUris.add(tok.nextToken().trim());
  }
  AxisService axisService = createAxisClientService(target, classLoader);
  for (InvocationChain chain : wire.getInvocationChains()) {
    String operation = chain.getPhysicalOperation().getName();
    Set<AxisPolicy> policies = target.getPolicies(operation);
    Map<String, String> opInfo = target.getOperationInfo() != null ? target.getOperationInfo().get(operation) : null;
    Interceptor interceptor = new Axis2TargetInterceptor(endpointUris,
                               operation,
                               policies,
                               opInfo,
                               target.getConfig(),
                               f3Configurator,
                               policyApplier,
                               axisService,
                               classLoader);
    chain.addInterceptor(interceptor);
  }
}

代码示例来源:origin: org.codehaus.fabric3/fabric3-binding-rs-jersey

public void attach(PhysicalSourceDefinition sourceDefinition, RsTargetDefinition def, Wire wire) throws WiringException {
  ClassLoader targetClassLoader = classLoaderRegistry.getClassLoader(def.getClassLoaderId());
  List<InvocationChain> invocationChains = wire.getInvocationChains();
  URI uri = def.getUri();
  String interfaze = def.getProxyInterface();
  try {
    Class<?> interfaceClass = targetClassLoader.loadClass(interfaze);
    for (InvocationChain chain : invocationChains) {
      PhysicalOperationDefinition operation = chain.getPhysicalOperation();
      String operationName = operation.getName();
      List<String> targetParameterTypes = operation.getTargetParameterTypes();
      Class<?> args[] = new Class<?>[targetParameterTypes.size()];
      for (int i = 0; i < args.length; i++) {
        args[i] = targetClassLoader.loadClass(targetParameterTypes.get(i));
      }
      chain.addInterceptor(new RsClientInterceptor(operationName, interfaceClass, uri, args));
    }
  } catch (Exception e) {
    throw new WiringException(e);
  }
}

代码示例来源:origin: org.codehaus.fabric3/fabric3-spring

public void attach(PhysicalSourceDefinition source, SpringTargetDefinition target, Wire wire) throws WiringException {
  String beanName = target.getBeanName();
  ClassLoader loader = classLoaderRegistry.getClassLoader(target.getClassLoaderId());
  Class<?> interfaze;
  try {
    interfaze = loader.loadClass(target.getBeanInterface());
  } catch (ClassNotFoundException e) {
    throw new WiringException(e);
  }
  for (WireListener listener : listeners) {
    listener.onAttach(wire);
  }
  SpringComponent component = getComponent(target);
  for (InvocationChain chain : wire.getInvocationChains()) {
    PhysicalOperationDefinition operation = chain.getPhysicalOperation();
    Method beanMethod = MethodUtils.findMethod(source, target, operation, interfaze, loader, classLoaderRegistry);
    SpringInvoker invoker = new SpringInvoker(beanName, beanMethod, component);
    chain.addInterceptor(invoker);
  }
}

代码示例来源:origin: org.codehaus.fabric3/fabric3-junit

public void attach(JUnitSourceDefinition source, PhysicalTargetDefinition target, Wire wire) throws WiringException {
  String testName = source.getTestName();
  ContextConfiguration configuration = source.getConfiguration();
  if (configuration != null) {
    if (authenticationService == null) {
      throw new WiringException("Security information set for the test but a security extension has not been installed in the runtime");
    }
    // configuration an authentication interceptor to set the subject on the work context
    for (InvocationChain chain : wire.getInvocationChains()) {
      Interceptor next = chain.getHeadInterceptor();
      String username = configuration.getUsername();
      String password = configuration.getPassword();
      AuthenticatingInterceptor interceptor = new AuthenticatingInterceptor(username, password, authenticationService, next);
      chain.addInterceptor(0, interceptor);
    }
  }
  holder.add(testName, wire);
}

代码示例来源:origin: org.codehaus.fabric3/fabric3-junit

for (InvocationChain chain : wire.getInvocationChains()) {
  PhysicalOperationDefinition operation = chain.getPhysicalOperation();
  Method method = MethodUtils.findMethod(sourceDefinition, targetDefinition, operation, implementationClass, loader, classLoaderRegistry);

代码示例来源:origin: org.codehaus.fabric3/fabric3-fabric

ClassLoader sourceLoader = null;
ClassLoader targetLoader = null;
for (InvocationChain chain : wire.getInvocationChains()) {
  if (checkPassByRef && chain.getPhysicalOperation().isAllowsPassByReference()) {
    continue;

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com