Tabnine Logo
LocalBeanProxyFactory.isProxy
Code IndexAdd Tabnine to your IDE (free)

How to use
isProxy
method
in
org.apache.openejb.util.proxy.LocalBeanProxyFactory

Best Java code snippets using org.apache.openejb.util.proxy.LocalBeanProxyFactory.isProxy (Showing top 7 results out of 315)

origin: org.apache.openejb/openejb-cxf-rs

private Collection<Class<?>> getContextTypes(final Object resourceObject) {
  if (!ProxyManager.isProxyClass(resourceObject.getClass())
    && !LocalBeanProxyFactory.isProxy(resourceObject.getClass())) {
    return Collections.emptySet();
  }
  final InvocationHandler handler = ProxyManager.getInvocationHandler(resourceObject);
  if (!(handler instanceof BeanContextInvocationHandler)) {
    return Collections.emptySet();
  }
  final BeanContext beanContext = ((BeanContextInvocationHandler) handler).getBeanContext();
  if (beanContext == null) {
    return Collections.emptySet();
  }
  return contextTypes.get(beanContext.getBeanClass());
}
origin: org.apache.tomee/openejb-core

@SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
public boolean equals(Object obj) {
  if (obj == null) {
    return false;
  }
  if (this == obj) {
    return true;
  }
  if (!BaseEjbProxyHandler.class.isInstance(obj)) {
    final Class<?> aClass = obj.getClass();
    if (Proxy.isProxyClass(aClass)) {
      obj = Proxy.getInvocationHandler(obj);
    } else if (LocalBeanProxyFactory.isProxy(aClass)) {
      obj = LocalBeanProxyFactory.getInvocationHandler(obj);
    } else {
      return false;
    }
  }
  return equalHandler(BaseEjbProxyHandler.class.cast(obj));
}
origin: org.apache.openejb/openejb-core

@SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
public boolean equals(Object obj) {
  if (obj == null) {
    return false;
  }
  if (this == obj) {
    return true;
  }
  if (!BaseEjbProxyHandler.class.isInstance(obj)) {
    final Class<?> aClass = obj.getClass();
    if (Proxy.isProxyClass(aClass)) {
      obj = Proxy.getInvocationHandler(obj);
    } else if (LocalBeanProxyFactory.isProxy(aClass)) {
      obj = LocalBeanProxyFactory.getInvocationHandler(obj);
    } else {
      return false;
    }
  }
  final BaseEjbProxyHandler other = (BaseEjbProxyHandler) obj;
  return equalHandler(other);
}
origin: org.apache.tomee/openejb-core

public static InvocationHandler getInvocationHandler(final Object proxy) {
  if (LocalBeanProxyFactory.isProxy(proxy.getClass())) {
    return LocalBeanProxyFactory.getInvocationHandler(proxy);
  }
  checkDefaultFactory();
  return defaultFactory.getInvocationHandler(proxy);
}
origin: org.apache.openejb/openejb-core

public static InvocationHandler getInvocationHandler(final Object proxy) {
  if (LocalBeanProxyFactory.isProxy(proxy.getClass())) {
    return LocalBeanProxyFactory.getInvocationHandler(proxy);
  }
  checkDefaultFactory();
  return defaultFactory.getInvocationHandler(proxy);
}
origin: org.apache.openejb/openejb-core

private void destroyScopedStateful(final T instance, final CreationalContext<T> cc) {
  try {
    instance.hashCode(); // force the instance to be created - otherwise we'll miss @PreDestroy for instance
  } catch (final NoSuchEJBException e) {
    InvocationHandler handler = null;
    if (LocalBeanProxyFactory.isProxy(instance.getClass())) {
      handler = LocalBeanProxyFactory.getInvocationHandler(instance);
    } else if (ProxyManager.isProxyClass(instance.getClass())) {
      handler = ProxyManager.getInvocationHandler(instance);
    }
    if (BaseEjbProxyHandler.class.isInstance(handler) && !BaseEjbProxyHandler.class.cast(handler).isValid()) {
      return; // already destroyed
    } // else log error
    logger.log(Level.FINE, "The stateful instance " + instance + " can't be removed since it was invalidated", e);
    return;
  }
  final Object ejbInstance = dependentSFSBToBeRemoved.remove(System.identityHashCode(instance));
  if (ejbInstance != null) {
    destroyStatefulSessionBeanInstance((T) ejbInstance, cc);
  } else {
    destroyStatefulSessionBeanInstance(instance, cc);
  }
}
origin: org.apache.tomee/openejb-core

private void destroyScopedStateful(final T instance, final CreationalContext<T> cc) {
  try {
    instance.hashCode(); // force the instance to be created - otherwise we'll miss @PreDestroy for instance
  } catch (final NoSuchEJBException e) {
    InvocationHandler handler = null;
    if (LocalBeanProxyFactory.isProxy(instance.getClass())) {
      handler = LocalBeanProxyFactory.getInvocationHandler(instance);
    } else if (ProxyManager.isProxyClass(instance.getClass())) {
      handler = ProxyManager.getInvocationHandler(instance);
    }
    if (BaseEjbProxyHandler.class.isInstance(handler) && !BaseEjbProxyHandler.class.cast(handler).isValid()) {
      return; // already destroyed
    } // else log error
    logger.log(Level.FINE, "The stateful instance " + instance + " can't be removed since it was invalidated", e);
    return;
  }
  final Object ejbInstance = dependentSFSBToBeRemoved.remove(System.identityHashCode(instance));
  if (ejbInstance != null) {
    destroyStatefulSessionBeanInstance((T) ejbInstance, cc);
  } else {
    destroyStatefulSessionBeanInstance(instance, cc);
  }
}
org.apache.openejb.util.proxyLocalBeanProxyFactoryisProxy

Popular methods of LocalBeanProxyFactory

  • createProxy
  • newProxyInstance
  • constructProxy
  • createArrayDefinition
    pushes an array of the specified size to the method visitor. The generated bytecode will leave the n
  • generateProxy
  • getAsmTypeAsString
    Converts a class to a String suitable for ASM.
  • getCastType
    Gets the string to use for CHECKCAST instruction, returning the correct value for any type, includin
  • getDeclaredField
  • getInvocationHandler
  • getMethodSignatureAsString
  • getNonPrivateMethods
  • getPrimitiveLetter
    Returns the single letter that matches the given primitive in bytecode instructions
  • getNonPrivateMethods,
  • getPrimitiveLetter,
  • getPrimitiveMethod,
  • getReturnInsn,
  • getVarInsn,
  • getWrapperType,
  • isOverridden,
  • processMethod,
  • pushIntOntoStack

Popular in Java

  • Start an intent from android
  • getSystemService (Context)
  • getResourceAsStream (ClassLoader)
  • getExternalFilesDir (Context)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • 21 Best IntelliJ 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