Java 类javax.ejb.EJBHome 实例源码

项目:ojb    文件:StressTest.java   
/**
 * Setting up the test fixture.
 */
private void init() throws Exception
{
    Context ctx = ContextHelper.getContext();
    times = new long[4];
    try
    {
        Object object = PortableRemoteObject.narrow(ctx.lookup(PBSessionHome.JNDI_NAME), EJBHome.class);
        bean = ((PBSessionHome) object).create();
    }
    catch(Exception e)
    {
        e.printStackTrace(System.err);
        throw e;
    }
}
项目:ojb    文件:StressTest.java   
/**
 * Setting up the test fixture.
 */
private void init() throws Exception
{
    Context ctx = ContextHelper.getContext();
    times = new long[4];
    try
    {
        Object object = PortableRemoteObject.narrow(ctx.lookup(ODMGSessionHome.JNDI_NAME), EJBHome.class);
        bean = ((ODMGSessionHome) object).create();
    }
    catch(Exception e)
    {
        e.printStackTrace(System.err);
        throw e;
    }
}
项目:tomee    文件:BmpRmiIiopTests.java   
public void test39_returnEJBHomeArray() {
    try {

        final EncBmpHome[] expected = new EncBmpHome[3];
        for (int i = 0; i < expected.length; i++) {
            final Object obj = initialContext.lookup("client/tests/entity/bmp/EncBean");
            expected[i] = (EncBmpHome) obj;
            assertNotNull("The EJBHome returned from JNDI is null", expected[i]);
        }

        final EJBHome[] actual = ejbObject.returnEJBHomeArray(expected);
        assertNotNull("The EJBHome array returned is null", actual);
        assertEquals(expected.length, actual.length);

    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
项目:tomee    文件:Complex2HomeHandleTests.java   
public void Xtest03_copyHandleBySerialize() {
    try {
        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
        final ObjectOutputStream oos = new ObjectOutputStream(baos);
        oos.writeObject(ejbHomeHandle);
        oos.flush();
        oos.close();
        final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
        final ObjectInputStream ois = new ObjectInputStream(bais);
        final HomeHandle copy = (HomeHandle) ois.readObject();

        assertNotNull("The HomeHandle copy is null", copy);
        final EJBHome home = copy.getEJBHome();
        assertNotNull("The EJBHome is null", home);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
项目:tomee    文件:Cmp2RmiIiopTests.java   
public void Xtest39_returnEJBHomeArray() {
    try {

        final EncCmpHome[] expected = new EncCmpHome[3];
        for (int i = 0; i < expected.length; i++) {
            final Object obj = initialContext.lookup("client/tests/entity/cmp/EncBean");
            expected[i] = (EncCmpHome) obj;
            assertNotNull("The EJBHome returned from JNDI is null", expected[i]);
        }

        final EJBHome[] actual = ejbObject.returnEJBHomeArray(expected);
        assertNotNull("The EJBHome array returned is null", actual);
        assertEquals(expected.length, actual.length);

    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
项目:tomee    文件:Cmp2HomeHandleTests.java   
public void Xtest03_copyHandleBySerialize() {
    try {
        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
        final ObjectOutputStream oos = new ObjectOutputStream(baos);
        oos.writeObject(ejbHomeHandle);
        oos.flush();
        oos.close();
        final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
        final ObjectInputStream ois = new ObjectInputStream(bais);
        final HomeHandle copy = (HomeHandle) ois.readObject();

        assertNotNull("The HomeHandle copy is null", copy);
        final EJBHome home = copy.getEJBHome();
        assertNotNull("The EJBHome is null", home);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
项目:tomee    文件:Unknown2HomeHandleTests.java   
public void Xtest03_copyHandleBySerialize() {
    try {
        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
        final ObjectOutputStream oos = new ObjectOutputStream(baos);
        oos.writeObject(ejbHomeHandle);
        oos.flush();
        oos.close();
        final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
        final ObjectInputStream ois = new ObjectInputStream(bais);
        final HomeHandle copy = (HomeHandle) ois.readObject();

        assertNotNull("The HomeHandle copy is null", copy);
        final EJBHome home = copy.getEJBHome();
        assertNotNull("The EJBHome is null", home);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
项目:tomee    文件:CmpRmiIiopTests.java   
public void test39_returnEJBHomeArray() {
    try {

        final EncCmpHome[] expected = new EncCmpHome[3];
        for (int i = 0; i < expected.length; i++) {
            final Object obj = initialContext.lookup("client/tests/entity/cmp/EncBean");
            expected[i] = (EncCmpHome) obj;
            assertNotNull("The EJBHome returned from JNDI is null", expected[i]);
        }

        final EJBHome[] actual = ejbObject.returnEJBHomeArray(expected);
        assertNotNull("The EJBHome array returned is null", actual);
        assertEquals(expected.length, actual.length);

    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
项目:tomee    文件:StatefulRmiIiopTests.java   
public void test39_returnEJBHomeArray() {
    try {

        final EncStatefulHome[] expected = new EncStatefulHome[3];
        for (int i = 0; i < expected.length; i++) {
            final Object obj = initialContext.lookup("client/tests/stateful/EncBean");
            expected[i] = (EncStatefulHome) obj;
            assertNotNull("The EJBHome returned from JNDI is null", expected[i]);
        }

        final EJBHome[] actual = ejbObject.returnEJBHomeArray(expected);
        assertNotNull("The EJBHome array returned is null", actual);
        assertEquals(expected.length, actual.length);

    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
项目:tomee    文件:StatelessRmiIiopTests.java   
public void test39_returnEJBHomeArray() {
    try {

        final EncStatelessHome[] expected = new EncStatelessHome[3];
        for (int i = 0; i < expected.length; i++) {
            final Object obj = initialContext.lookup("client/tests/stateless/EncBean");
            expected[i] = (EncStatelessHome) obj;
            assertNotNull("The EJBHome returned from JNDI is null", expected[i]);
        }

        final EJBHome[] actual = ejbObject.returnEJBHomeArray(expected);
        assertNotNull("The EJBHome array returned is null", actual);
        assertEquals(expected.length, actual.length);

    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
项目:tomee    文件:SingletonRmiIiopTests.java   
public void test39_returnEJBHomeArray() {
    try {

        final EncSingletonHome[] expected = new EncSingletonHome[3];
        for (int i = 0; i < expected.length; i++) {
            final Object obj = initialContext.lookup("client/tests/singleton/EncBean");
            expected[i] = (EncSingletonHome) obj;
            assertNotNull("The EJBHome returned from JNDI is null", expected[i]);
        }

        final EJBHome[] actual = ejbObject.returnEJBHomeArray(expected);
        assertNotNull("The EJBHome array returned is null", actual);
        assertEquals(expected.length, actual.length);

    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
项目:tomee    文件:AnnotationDeployer.java   
/**
 * Checks that the values specified via @Local and @Remote are *not*:
 * <p/>
 * - classes
 * - derived from javax.ejb.EJBObject
 * - derived from javax.ejb.EJBHome
 * - derived from javax.ejb.EJBLocalObject
 * - derived from javax.ejb.EJBLocalHome
 *
 * @param interfce
 * @param validation
 * @param ejbName
 * @param annotationName
 * @return
 */
private boolean isValidInterface(final Class interfce, final ValidationContext validation, final String ejbName, final String annotationName) {
    if (!interfce.isInterface()) {
        validation.fail(ejbName, "ann.notAnInterface", annotationName, interfce.getName());
        return false;
    } else if (EJBHome.class.isAssignableFrom(interfce)) {
        validation.fail(ejbName, "ann.remoteOrLocal.ejbHome", annotationName, interfce.getName());
        return false;
    } else if (EJBObject.class.isAssignableFrom(interfce)) {
        validation.fail(ejbName, "ann.remoteOrLocal.ejbObject", annotationName, interfce.getName());
        return false;
    } else if (EJBLocalHome.class.isAssignableFrom(interfce)) {
        validation.fail(ejbName, "ann.remoteOrLocal.ejbLocalHome", annotationName, interfce.getName());
        return false;
    } else if (EJBLocalObject.class.isAssignableFrom(interfce)) {
        validation.fail(ejbName, "ann.remoteOrLocal.ejbLocalObject", annotationName, interfce.getName());
        return false;
    }
    return true;
}
项目:tomee    文件:CheckMethods.java   
private void check_homeInterfaceMethods(final RemoteBean b) {
        Class home = null;
        Class bean = null;
        try {
            home = loadClass(b.getHome());
            bean = loadClass(b.getEjbClass());
        } catch (final OpenEJBException e) {
            return;
        }

        if (!EJBHome.class.isAssignableFrom(home)) {
            return;
        }

        if (check_hasCreateMethod(b, bean, home)) {
            check_createMethodsAreImplemented(b, bean, home);
            // ejbPostCreate methods are now automatically generated
//            check_postCreateMethodsAreImplemented(b, bean, home);
        }
    }
项目:tomee    文件:ProxyFactory.java   
public ProxyFactory(final BeanContext beanContext) {
    this.beanContext = beanContext;
    keyGenerator = beanContext.getKeyGenerator();

    remoteInterface = beanContext.getRemoteInterface();
    if (remoteInterface != null) {
        final EJBHome homeProxy = beanContext.getEJBHome();
        remoteHandler = (EntityEjbHomeHandler) ProxyManager.getInvocationHandler(homeProxy);
    } else {
        remoteHandler = null;
    }

    localInterface = beanContext.getLocalInterface();
    if (localInterface != null) {
        final EJBLocalHome localHomeProxy = beanContext.getEJBLocalHome();
        localHandler = (EntityEjbHomeHandler) ProxyManager.getInvocationHandler(localHomeProxy);
    } else {
        localHandler = null;
    }
}
项目:Mastering-Java-EE-Development-with-WildFly    文件:Ejb21EngineRemoteBean.java   
@Override
public void log() throws RemoteException {
    Principal principal = context.getCallerPrincipal();
    Map<String, Object> contextData = context.getContextData();
    EJBHome ejbHome = context.getEJBHome();
    EJBObject ejbObject = context.getEJBObject();
    Ejb21Remote RemoteEngine = context.getBusinessObject(Ejb21Remote.class);
    boolean isCallerInRole = context.isCallerInRole("admin");
    logger.info("ejb21RemoteEngineBean principal: " + principal);
    logger.info("ejb21RemoteEngineBean contextData:" + contextData);
    logger.info("ejb21RemoteEngineBean ejbHome:" + ejbHome);
    logger.info("ejb21RemoteEngineBean ejbObject:" + ejbObject);
    logger.info("ejb21RemoteEngineBean RemoteEngineBean:" + RemoteEngine);
    logger.info("ejb21RemoteEngineBean isCallerInRole:" + isCallerInRole);
}
项目:Mastering-Java-EE-Development-with-WildFly    文件:Ejb21StateEngineRemoteBean.java   
@Override
public void log() throws RemoteException {
    Principal principal = context.getCallerPrincipal();
    Map<String, Object> contextData = context.getContextData();
    EJBHome ejbHome = context.getEJBHome();
    EJBObject ejbObject = context.getEJBObject();
    Ejb21StateRemote stateRemoteEngine = context.getBusinessObject(Ejb21StateRemote.class);
    boolean isCallerInRole = context.isCallerInRole("admin");
    logger.info("stateRemoteEngineBean principal: " + principal);
    logger.info("stateRemoteEngineBean contextData:" + contextData);
    logger.info("stateRemoteEngineBean ejbHome:" + ejbHome);
    logger.info("stateRemoteEngineBean ejbObject:" + ejbObject);
    logger.info("stateRemoteEngineBean stateRemoteEngineBean:" + stateRemoteEngine);
    logger.info("stateRemoteEngineBean isCallerInRole:" + isCallerInRole);
}
项目:lams    文件:AbstractRemoteSlsbInvokerInterceptor.java   
/**
 * Check for EJB3-style home object that serves as EJB component directly.
 */
@Override
protected Method getCreateMethod(Object home) throws EjbAccessException {
    if (this.homeAsComponent) {
        return null;
    }
    if (!(home instanceof EJBHome)) {
        // An EJB3 Session Bean...
        this.homeAsComponent = true;
        return null;
    }
    return super.getCreateMethod(home);
}
项目:spring4-understanding    文件:AbstractRemoteSlsbInvokerInterceptor.java   
/**
 * Check for EJB3-style home object that serves as EJB component directly.
 */
@Override
protected Method getCreateMethod(Object home) throws EjbAccessException {
    if (this.homeAsComponent) {
        return null;
    }
    if (!(home instanceof EJBHome)) {
        // An EJB3 Session Bean...
        this.homeAsComponent = true;
        return null;
    }
    return super.getCreateMethod(home);
}
项目:my-spring-cache-redis    文件:AbstractRemoteSlsbInvokerInterceptor.java   
/**
 * Check for EJB3-style home object that serves as EJB component directly.
 */
@Override
protected Method getCreateMethod(Object home) throws EjbAccessException {
    if (this.homeAsComponent) {
        return null;
    }
    if (!(home instanceof EJBHome)) {
        // An EJB3 Session Bean...
        this.homeAsComponent = true;
        return null;
    }
    return super.getCreateMethod(home);
}
项目:BJAF3.x    文件:HomeFactoryHelper.java   
private static synchronized EJBHome getRemoteHome(
        String ejbContainerTagName, String jndiName, Class<?> className,
        String key) throws java.rmi.RemoteException, ClassNotFoundException {
    Context ctx;
    if (logger.isDebugEnabled()) {
        logger.debug("--getRemoteHome--");
        logger.debug("ejbContainerTagName:" + ejbContainerTagName);
        logger.debug("jndiName:" + jndiName);
        logger.debug("className:" + className);
        logger.debug("key:" + key);
    }
    try {
        if (ejbContainerTagName == null || ejbContainerTagName.equals("")) {
            ctx = ContainerUtil.getRemoteEJBContainerContext();
            if (logger.isDebugEnabled()) {
                logger.debug("call:getRemoteEJBContainerContext()");
            }
        } else {
            ctx = ContainerUtil
                    .getRemoteEJBContainerContext(ejbContainerTagName);
            if (logger.isDebugEnabled()) {
                logger.debug("call:getRemoteEJBContainerContext("
                        + ejbContainerTagName + ")");
            }
        }
        Object ref = ctx.lookup(jndiName.trim());
        EJBHome ejbHome = (EJBHome) PortableRemoteObject.narrow(ref,
                className);
        HOME_INTERFACES_REMOTE.put(key, ejbHome);
        return ejbHome;
    } catch (NamingException e) {
        throw new RemoteException("getRemoteHome err", e);
    }
}
项目:spring    文件:AbstractRemoteSlsbInvokerInterceptor.java   
/**
 * Check for EJB3-style home object that serves as EJB component directly.
 */
@Override
protected Method getCreateMethod(Object home) throws EjbAccessException {
    if (this.homeAsComponent) {
        return null;
    }
    if (!(home instanceof EJBHome)) {
        // An EJB3 Session Bean...
        this.homeAsComponent = true;
        return null;
    }
    return super.getCreateMethod(home);
}
项目:r01fb    文件:EJB2HomeLocator.java   
/**
 * Obtiene el Home remoto del ejb 
 * El acceso a este m�todo �nicamente puede hacerse a partir de la instancia del singleton:
 *      <code>EJB2ServiceLocator.getInstance().getLocalHome(jndiName,"com.acme.ejb.MyHome");</code>
 * @param jndiContextProviderURL url del provider de contexto JNDI
 * @param jndiName Nombre jndi del ejb
 * @param homeClassName Nombre de la Clase (Class) para devolver el objeto tipado
 * @return El objeto tipado
 */
public EJBHome getRemoteHome(final String jndiContextProviderURL,
                             final String jndiName,final String homeClassName) {
    EJBHome home = null;
    try {
        home = this.getRemoteHome(jndiContextProviderURL,
                                  jndiName,Reflection.type(homeClassName).getType());
    } catch (ReflectionException cnfEx) {
        // TODO logging
        String err = Strings.of("NO se ha encontrado la clase {} para hacer un narrow del objeto home > {}")
                            .customizeWith(homeClassName,cnfEx.getMessage()).asString();
        System.out.println(err);
    }
    return home;
}
项目:class-guard    文件:AbstractRemoteSlsbInvokerInterceptor.java   
/**
 * Check for EJB3-style home object that serves as EJB component directly.
 */
@Override
protected Method getCreateMethod(Object home) throws EjbAccessException {
    if (this.homeAsComponent) {
        return null;
    }
    if (!(home instanceof EJBHome)) {
        // An EJB3 Session Bean...
        this.homeAsComponent = true;
        return null;
    }
    return super.getCreateMethod(home);
}
项目:ojb    文件:PBClient.java   
protected void init()
{
    Context ctx = ContextHelper.getContext();
    try
    {
        Object object = PortableRemoteObject.narrow(ctx.lookup(PBSessionHome.JNDI_NAME), EJBHome.class);
        bean = ((PBSessionHome) object).create();
    }
    catch (Exception e)
    {
        e.printStackTrace();
    }
}
项目:ojb    文件:PersonArticleClient.java   
protected void init() throws Exception
{
    try
    {
        Object object = PortableRemoteObject.narrow(
        ContextHelper.getContext().lookup(PersonArticleManagerPBHome.JNDI_NAME), EJBHome.class);
        bean = (PersonArticleManagerPBRemote) ((PersonArticleManagerPBHome) object).create();
        System.out.println("Bean found: " + bean);
    }
    catch (Exception e)
    {
        e.printStackTrace();
        throw e;
    }
}
项目:ojb    文件:RollbackClient.java   
protected void init()
{
    Context ctx = ContextHelper.getContext();
    try
    {
        Object object = PortableRemoteObject.narrow(ctx.lookup(RollbackHome.JNDI_NAME), EJBHome.class);
        rollbackBean = ((RollbackHome) object).create();
    }
    catch (Exception e)
    {
        e.printStackTrace();
    }
}
项目:ojb    文件:StressTest.java   
protected void init()
{
    Context ctx = ContextHelper.getContext();
    try
    {
        Object object = PortableRemoteObject.narrow(ctx.lookup(PBSessionHome.JNDI_NAME), EJBHome.class);
        bean = ((PBSessionHome) object).create();
    }
    catch(Exception e)
    {
        e.printStackTrace();
        throw new OJBRuntimeException("Can't lookup bean: " + PBSessionHome.JNDI_NAME, e);
    }
}
项目:ojb    文件:ArticleTestClient.java   
protected void init() throws Exception
{
    try
    {
        Object object = PortableRemoteObject.narrow(
                ContextHelper.getContext().lookup(ArticleManagerPBHome.JNDI_NAME), EJBHome.class);
        pbArticleBean = ((ArticleManagerPBHome) object).create();
    }
    catch (Exception e)
    {
        e.printStackTrace();
        throw e;
    }
}
项目:ojb    文件:RollbackClient.java   
protected void init()
{
    Context ctx = ContextHelper.getContext();
    try
    {
        Object object = PortableRemoteObject.narrow(ctx.lookup(RollbackHome.JNDI_NAME), EJBHome.class);
        rollbackBean = ((RollbackHome) object).create();
    }
    catch (Exception e)
    {
        e.printStackTrace();
    }
}
项目:ojb    文件:StressTest.java   
protected void init()
{
    Context ctx = ContextHelper.getContext();
    try
    {
        Object object = PortableRemoteObject.narrow(ctx.lookup(ODMGSessionHome.JNDI_NAME), EJBHome.class);
        bean = ((ODMGSessionHome) object).create();
    }
    catch(Exception e)
    {
        e.printStackTrace();
        throw new OJBRuntimeException("Can't lookup bean: " + ODMGSessionHome.JNDI_NAME, e);
    }
}
项目:ojb    文件:ArticleTestClient.java   
protected void init() throws Exception
{
    try
    {
        Object object = PortableRemoteObject.narrow(
                ContextHelper.getContext().lookup(ArticleManagerODMGHome.JNDI_NAME), EJBHome.class);
        odmgArticleBean = ((ArticleManagerODMGHome) object).create();
    }
    catch (Exception e)
    {
        e.printStackTrace();
        throw e;
    }
}
项目:ojb    文件:ODMGClient.java   
protected void init()
{
    Context ctx = ContextHelper.getContext();
    try
    {
        Object object = PortableRemoteObject.narrow(ctx.lookup(ODMGSessionHome.JNDI_NAME), EJBHome.class);
        sampleBean = ((ODMGSessionHome) object).create();
    }
    catch (Exception e)
    {
        e.printStackTrace();
    }
}
项目:ojb    文件:PersonArticleClientODMG.java   
protected void init() throws Exception
{
    try
    {
        Object object = PortableRemoteObject.narrow(
        ContextHelper.getContext().lookup(PersonArticleManagerODMGHome.JNDI_NAME), EJBHome.class);
        bean = ((PersonArticleManagerODMGHome) object).create();
    }
    catch (Exception e)
    {
        e.printStackTrace();
        throw e;
    }
}
项目:study-ocbcd    文件:ServiceLocator.java   
/**
 * Do the look up for the EJB Home in the JNDI.
 * @param jndiName name in the JNDI
 * @param classEjbHome Class of home interface of the EJB
 * @return return the EJBHome object narrowed
 * @throws NamingException
 */
public EJBHome getHome(String jndiName, Class classEjbHome) throws NamingException {

    // find the Advice bean using JNDI
    Object obj = context.lookup(jndiName);
    // narrow the obj
    EJBHome ejbHome = (EJBHome) PortableRemoteObject.narrow(obj, classEjbHome);

    return ejbHome;
}
项目:study-ocbcd    文件:ServiceLocator.java   
/**
 * Do the look up for the EJB Home in the JNDI.
 * @param jndiName name in the JNDI
 * @param classEjbHome Class of home interface of the EJB
 * @return return the EJBHome object narrowed
 * @throws NamingException
 */
public static EJBHome getHome(String jndiName, Class classEjbHome) throws NamingException {
    // gets the entry point into the JNDI naming service
    Context ctx = new InitialContext();

    // find the Advice bean using JNDI
    Object obj = ctx.lookup(jndiName);
    // narrow the obj
    EJBHome ejbHome = (EJBHome) PortableRemoteObject.narrow(obj, classEjbHome);

    return ejbHome;
}
项目:study-ocbcd    文件:ServiceLocator.java   
/**
 * Do the look up for the EJB Home in the JNDI.
 * @param jndiName name in the JNDI
 * @param classEjbHome Class of home interface of the EJB
 * @return return the EJBHome object narrowed
 * @throws NamingException
 */
//@SuppressWarnings("rawtypes")
public EJBHome getHome(String jndiName, Class classEjbHome) throws NamingException {

    // find the Advice bean using JNDI
    Object obj = context.lookup(jndiName);
    // narrow the obj
    EJBHome ejbHome = (EJBHome) PortableRemoteObject.narrow(obj, classEjbHome);

    return ejbHome;
}
项目:tomee    文件:EJBMetaDataImpl.java   
@Override
public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
    final byte version = in.readByte(); // future use

    homeClass = (Class) in.readObject();
    remoteClass = (Class) in.readObject();
    keyClass = (Class) in.readObject();
    ejbHomeProxy = (EJBHome) in.readObject();
    type = in.readByte();
    deploymentID = in.readUTF();
    deploymentCode = in.readShort();

    for (int i = in.readShort(); i > 0; i--) {
        businessClasses.add((Class) in.readObject());
    }
    if (businessClasses.size() > 0) {
        primaryKey = in.readObject();
    }
    if (version > 2) {
        mainInterface = (Class) in.readObject();
    }
    if (version > 1) {
        final byte typeIndex = in.readByte();
        interfaceType = InterfaceType.values()[typeIndex];
    }
    for (int i = in.readInt(); i > 0; i--) {
        asynchronousMethods.add((String) in.readObject());
    }

    final boolean hasProperties = in.readBoolean();
    if (hasProperties) {
        final int bufferLength = in.readInt();
        final byte[] buffer = new byte[bufferLength];
        in.read(buffer);
        final ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
        properties.load(bais);
    }
}
项目:tomee    文件:EJBInvocationHandler.java   
public EJBInvocationHandler(final EJBMetaDataImpl ejb, final ServerMetaData server, final ClientMetaData client, final JNDIContext.AuthenticationInfo auth) {
    this.ejb = ejb;
    this.server = server;
    this.client = client;
    this.authenticationInfo = auth;
    final Class remoteInterface = ejb.getRemoteInterfaceClass();
    remote = remoteInterface != null && (EJBObject.class.isAssignableFrom(remoteInterface) || EJBHome.class.isAssignableFrom(remoteInterface));
}
项目:tomee    文件:BmpHomeHandleTests.java   
public void test01_getEJBHome() {
    try {
        final EJBHome home = ejbHomeHandle.getEJBHome();
        assertNotNull("The EJBHome is null", home);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
项目:tomee    文件:BmpEjbMetaDataTests.java   
public void test01_getEJBHome() {
    try {
        final EJBHome home = ejbMetaData.getEJBHome();
        assertNotNull("The EJBHome is null", home);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}