Codota Logo
ServiceReference.getBusinessInterface
Code IndexAdd Codota to your IDE (free)

How to use
getBusinessInterface
method
in
org.oasisopen.sca.ServiceReference

Best Java code snippets using org.oasisopen.sca.ServiceReference.getBusinessInterface (Showing top 11 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: org.apache.tuscany.sca/tuscany-base-runtime

public JDKInvocationHandler(MessageFactory messageFactory, ServiceReference<?> callableReference) {
  this.messageFactory = messageFactory;
  this.callableReference = (ServiceReferenceExt<?>)callableReference;
  if (callableReference != null) {
    this.businessInterface = callableReference.getBusinessInterface();
    this.source = (RuntimeEndpointReference) this.callableReference.getEndpointReference();
  }
}
origin: org.ow2.frascati.tinfi/frascati-tinfi-mixins

public <B> ServiceReference<B> cast( B target )
throws IllegalArgumentException {
  
  if( !(target instanceof ServiceReference<?>) ) {
    String msg = "Not a reference: "+target;
    throw new IllegalArgumentException(msg);
  }
  
  ServiceReference<?> ci = (ServiceReference<?>) target;
  Class<?> businessInterface = ci.getBusinessInterface();
  Object service = ci.getService();
  
  // Create a ServiceReference
  String signature = businessInterface.getName();
  String clname = signature+"FcSR";
  try {
    Class<?> cl = Class.forName(clname);
    Constructor<?>[] ctrs = cl.getConstructors();
    Constructor<?> ctr = ctrs[0];
    Object sr = ctr.newInstance(businessInterface,service);
    
    @SuppressWarnings("unchecked")
    ServiceReference<B> ret = (ServiceReference<B>) sr;
    return ret;
  }
  catch (Exception e) {
    throw new IllegalArgumentException(e);
  }
}
origin: com.ebmwebsourcing.easycommons/easycommons-sca-impl

/** 
 * @see org.ow2.frascati.tinfi.control.component.ComponentContextMixin#cast(B)
 */
public <B> ServiceReference<B>  cast(B target) throws IllegalArgumentException {
  if (!(target instanceof ServiceReference<?> )) {
    String msg = "Not a reference: " + target;
    throw new IllegalArgumentException(msg);
  } 
  ServiceReference<?>  ci = ((ServiceReference<?> )(target));
  Class<?>  businessInterface = ci.getBusinessInterface();
  Object service = ci.getService();
  String signature = businessInterface.getName();
  String clname = signature + "FcSR";
  try {
    Class<?>  cl = Class.forName(clname);
    Constructor<?> [] ctrs = cl.getConstructors();
    Constructor<?>  ctr = ctrs[0];
    Object sr = ctr.newInstance(businessInterface ,service);
    @SuppressWarnings(value = "unchecked")
    ServiceReference<B>  ret = ((ServiceReference<B> )(sr));
    return ret;
  } catch (Exception e) {
    throw new IllegalArgumentException(e);
  }
}

origin: org.apache.tuscany.sca/tuscany-base-runtime

/**
 * create the proxy with cglib. use the same JDKInvocationHandler as
 * JDKProxyService.
 */
public <T> T createProxy(ServiceReference<T> callableReference) throws ProxyCreationException {
  Enhancer enhancer = new Enhancer();
  Class<T> interfaze = callableReference.getBusinessInterface();
  enhancer.setSuperclass(interfaze);
  enhancer.setCallback(new CglibMethodInterceptor<T>(callableReference));
  Object proxy = enhancer.create();
  ((ServiceReferenceImpl)callableReference).setProxy(proxy);
  return interfaze.cast(proxy);
}
origin: org.ow2.frascati.tinfi/frascati-tinfi-membranes-oo

/**
 * @see org.ow2.frascati.tinfi.control.component.ComponentContextMixin#cast(B)
 */
public <B> org.oasisopen.sca.ServiceReference<B> cast(B target) throws java.lang.IllegalArgumentException {
  if (!(target instanceof org.oasisopen.sca.ServiceReference<?>)) {
    java.lang.String msg = "Not a reference: " + target;
    throw new java.lang.IllegalArgumentException(msg);
  }
  org.oasisopen.sca.ServiceReference<?> ci = ((org.oasisopen.sca.ServiceReference<?>) (target));
  java.lang.Class<?> businessInterface = ci.getBusinessInterface();
  java.lang.Object service = ci.getService();
  java.lang.String signature = businessInterface.getName();
  java.lang.String clname = signature + "FcSR";
  try {
    java.lang.Class<?> cl = java.lang.Class.forName(clname);
    java.lang.reflect.Constructor<?>[] ctrs = cl.getConstructors();
    java.lang.reflect.Constructor<?> ctr = ctrs[0];
    java.lang.Object sr = ctr.newInstance(businessInterface, service);
    @java.lang.SuppressWarnings("unchecked")
    org.oasisopen.sca.ServiceReference<B> ret = ((org.oasisopen.sca.ServiceReference<B>) (sr));
    return ret;
  } catch (java.lang.Exception e) {
    throw new java.lang.IllegalArgumentException(e);
  }
}
origin: org.apache.tuscany.sca/tuscany-base-runtime

/**
 * create the callback proxy with cglib. use the same
 * JDKCallbackInvocationHandler as JDKProxyService.
 */
public <T> T createCallbackProxy(ServiceReference<T> callbackReference) throws ProxyCreationException {
  Enhancer enhancer = new Enhancer();
  Class<T> interfaze = callbackReference.getBusinessInterface();
  enhancer.setSuperclass(interfaze);
  enhancer.setCallback(new CglibMethodInterceptor<T>(callbackReference));
  Object object = enhancer.create();
  T proxy = interfaze.cast(object);
  ((ServiceReferenceExt<T>)callbackReference).setProxy(proxy);
  return proxy;
}
origin: org.apache.tuscany.sca/tuscany-base-runtime

public <T> T createCallbackProxy(ServiceReference<T> callbackReference) throws ProxyCreationException {
  assert callbackReference != null;
  final Class<T> interfaze = callbackReference.getBusinessInterface();
  InvocationHandler handler = new JDKCallbackInvocationHandler(messageFactory, callbackReference);
  ClassLoader cl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
    public ClassLoader run() {
      return interfaze.getClassLoader();
    }
  });
  T proxy = interfaze.cast(newProxyInstance(cl, new Class[] {interfaze}, handler));
  ((ServiceReferenceExt<T>)callbackReference).setProxy(proxy);
  return proxy;
}
origin: org.apache.tuscany.sca/tuscany-base-runtime

public <T> T createCallbackProxy(ServiceReference<T> callbackReference) throws ProxyCreationException {
  ProxyFactory interfaceFactory = proxyFactories.getInterfaceProxyFactory();
  ProxyFactory classFactory = proxyFactories.getClassProxyFactory();
  if (callbackReference.getBusinessInterface().isInterface()) {
    return interfaceFactory.createCallbackProxy(callbackReference);
  } else {
    return classFactory.createCallbackProxy(callbackReference);
  }
}
origin: org.apache.tuscany.sca/tuscany-base-runtime

public <T> T createProxy(ServiceReference<T> callableReference) throws ProxyCreationException {
  assert callableReference != null;
  final Class<T> interfaze = callableReference.getBusinessInterface();
  InvocationHandler handler;
  // TUSCANY-3659 - Always install a asynch handler regardless of whether ref is sync or async
  //                needs tidying
  //        if (isAsync(interfaze)) {
  handler = new AsyncJDKInvocationHandler(registry, messageFactory, callableReference);
  //        } else {
  //            handler = new JDKInvocationHandler(messageFactory, callableReference);
  //        }
  // Allow privileged access to class loader. Requires RuntimePermission in security policy.
  ClassLoader cl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
    public ClassLoader run() {
      return interfaze.getClassLoader();
    }
  });
  T proxy = interfaze.cast(newProxyInstance(cl, new Class[] {interfaze}, handler));
  ((ServiceReferenceExt<T>)callableReference).setProxy(proxy);
  return proxy;
}
origin: org.apache.tuscany.sca/tuscany-base-runtime

public <T> T createProxy(ServiceReference<T> callableReference) throws ProxyCreationException {
  ProxyFactory interfaceFactory = proxyFactories.getInterfaceProxyFactory();
  ProxyFactory classFactory = proxyFactories.getClassProxyFactory();
  if (callableReference.getBusinessInterface().isInterface()) {
    return interfaceFactory.createProxy(callableReference);
  } else {
    return classFactory.createProxy(callableReference);
  }
}
origin: org.ow2.frascati.tinfi/frascati-tinfi-runtime

if( ! cm.isEmpty() ) {
  ServiceReference<?> cr = cm.peek();
  Class<?> businessItf = cr.getBusinessInterface();
org.oasisopen.scaServiceReferencegetBusinessInterface

Javadoc

Returns the Java class for the business interface associated with this reference.

Popular methods of ServiceReference

  • getService
    Returns a type-safe reference to the target of this reference. The instance returned is guaranteed t

Popular in Java

  • Reactive rest calls using spring rest template
  • requestLocationUpdates (LocationManager)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • runOnUiThread (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now