Java 类javax.ejb.RemoveException 实例源码

项目:opennmszh    文件:AlarmListJ2eeConnectionManagerThread.java   
/**
 * Private method to finally clean up the connections
 */
private void cleanUp()
{
    try
    {
        session.remove();
    }
    catch(RemoveException remove_ex)
    {
        log.error("AlarmListJ2eeConnectionManagerThread.lookupBean() Cannot remove session", remove_ex);
    }
    catch(RemoteException remote_ex)
    {
        log.error("AlarmListJ2eeConnectionManagerThread.lookupBean() Connection to bean lost", remote_ex);
    }
}
项目:tomee    文件:BasicBmp2DataSourcesBean.java   
/**
 * A container invokes this method before it removes the EJB object
 * that is currently associated with the instance. This method
 * is invoked when a client invokes a remove operation on the
 * enterprise Bean's home interface or the EJB object's remote interface.
 * This method transitions the instance from the ready state to the pool
 * of available instances.
 */
public void ejbRemove() throws RemoveException, EJBException, RemoteException {
    try {
        final InitialContext jndiContext = new InitialContext();
        final DataSource ds = (DataSource) jndiContext.lookup("java:comp/env/jdbc/basic/entityDatabase");
        final Connection con = ds.getConnection();
        try {
            final PreparedStatement stmt = con.prepareStatement("delete from entity where id = ?");
            try {
                final Integer primaryKey = (Integer) ejbContext.getPrimaryKey();
                stmt.setInt(1, primaryKey.intValue());
                stmt.executeUpdate();
            } finally {
                stmt.close();
            }
        } finally {
            con.close();
        }

    } catch (final Exception e) {
        e.printStackTrace();
        throw new javax.ejb.EJBException(e);
    }
}
项目:tomee    文件:BasicBmpBean.java   
/**
 * A container invokes this method before it removes the EJB object
 * that is currently associated with the instance. This method
 * is invoked when a client invokes a remove operation on the
 * enterprise Bean's home interface or the EJB object's remote interface.
 * This method transitions the instance from the ready state to the pool
 * of available instances.
 */
public void ejbRemove() throws RemoveException, EJBException, RemoteException {
    try {
        final InitialContext jndiContext = new InitialContext();
        final DataSource ds = (DataSource) jndiContext.lookup("java:comp/env/jdbc/basic/entityDatabase");
        final Connection con = ds.getConnection();

        try {
            final PreparedStatement stmt = con.prepareStatement("delete from entity where id = ?");
            try {
                stmt.setInt(1, primaryKey);
                stmt.executeUpdate();
            } finally {
                stmt.close();
            }
        } finally {
            con.close();
        }

    } catch (final Exception e) {
        e.printStackTrace();
        throw new javax.ejb.EJBException(e);
    }
}
项目:OpenNMS    文件:AlarmListJ2eeConnectionManagerThread.java   
/**
 * Private method to finally clean up the connections
 */
private void cleanUp()
{
    try
    {
        session.remove();
    }
    catch(RemoveException remove_ex)
    {
        log.error("AlarmListJ2eeConnectionManagerThread.lookupBean() Cannot remove session", remove_ex);
    }
    catch(RemoteException remote_ex)
    {
        log.error("AlarmListJ2eeConnectionManagerThread.lookupBean() Connection to bean lost", remote_ex);
    }
}
项目:tomee    文件:JpaCmpEngine.java   
public void beforeDelete(final LifecycleEvent lifecycleEvent) {
    eventOccurred(lifecycleEvent);
    try {
        final Object bean = lifecycleEvent.getSource();
        cmpCallback.ejbRemove((EntityBean) bean);
    } catch (final RemoveException e) {
        throw new PersistenceException(e);
    }
}
项目:tomee    文件:CmpContainer.java   
private void ejbRemove(final EntityBean entityBean) throws RemoveException {
    if (entityBean == null) {
        throw new NullPointerException("entityBean is null");
    }
    if (isDeleted(entityBean)) {
        return;
    }

    final ThreadContext callContext = createThreadContext(entityBean);
    callContext.setCurrentOperation(Operation.REMOVE);

    final ThreadContext oldCallContext = ThreadContext.enter(callContext);
    try {
        entityBean.ejbRemove();
    } catch (final RemoteException e) {
        throw new EJBException(e);
    } finally {
        // clear relationships
        // todo replace with interface call when CmpEntityBean interface is added
        try {
            entityBean.getClass().getMethod("OpenEJB_deleted").invoke(entityBean);
        } catch (final Exception ignored) {
            // no-op
        }
        cancelTimers(callContext);
        ThreadContext.exit(oldCallContext);
    }
}
项目:Mastering-Java-EE-Development-with-WildFly    文件:Topic.java   
@Override
public void ejbRemove() throws RemoveException, EJBException, RemoteException {
    logger.info("ejbRemove");
}
项目:Mastering-Java-EE-Development-with-WildFly    文件:Ejb21EngineRemoteBean.java   
@Override
public void remove() throws RemoteException, RemoveException {
    logger.info("remove");
}
项目:Mastering-Java-EE-Development-with-WildFly    文件:Ejb21StateEngineRemoteBean.java   
@Override
public void remove() throws RemoteException, RemoveException {
    logger.info("remove");
}
项目:Mastering-Java-EE-Development-with-WildFly    文件:Ejb21StateEngineLocalBean.java   
@Override
public void remove() throws RemoveException, EJBException {
    logger.info("remove");
}
项目:Mastering-Java-EE-Development-with-WildFly    文件:Ejb21EngineLocalBean.java   
@Override
public void remove() throws RemoveException, EJBException {
    logger.info("remove");
}
项目:libreacs    文件:ProfilePropertySet.java   
@Override
protected void DeleteEntry(Property p) throws RemoveException {
    home.remove(new ProfilePropertyPK(profilename, p.getName()));
}
项目:libreacs    文件:ServicePropertySet.java   
@Override
protected void DeleteEntry(ServiceProperty p) throws RemoveException {
    home.remove(new ServicePropertyPK(Serviceid, p.getName()));
}
项目:libreacs    文件:HostPropertySet.java   
@Override
protected void DeleteEntry(Property p) throws RemoveException {
    //System.out.println ("HostPropertySet::DeleteEntry "+hostid+" "+p.getName());
    home.remove(new HostPropertyPK(hostid, p.getName()));
}
项目:openacs    文件:ProfilePropertySet.java   
@Override
protected void DeleteEntry(Property p) throws RemoveException {
    home.remove(new ProfilePropertyPK(profilename, p.getName()));
}
项目:openacs    文件:ServicePropertySet.java   
@Override
protected void DeleteEntry(ServiceProperty p) throws RemoveException {
    home.remove(new ServicePropertyPK(Serviceid, p.getName()));
}
项目:openacs    文件:HostPropertySet.java   
@Override
protected void DeleteEntry(Property p) throws RemoveException {
    //System.out.println ("HostPropertySet::DeleteEntry "+hostid+" "+p.getName());
    home.remove(new HostPropertyPK(hostid, p.getName()));
}
项目:tomee    文件:StatelessEJBHomeHandler.java   
@Override
protected Object removeByPrimaryKey(final Method method, final Object[] args, final Object proxy) throws Throwable {
    throw new ApplicationException(new RemoveException("Session objects are private resources and do not have primary keys"));
}
项目:tomee    文件:StatefulEJBHomeHandler.java   
@Override
protected Object removeByPrimaryKey(final Method method, final Object[] args, final Object proxy) throws Throwable {
    throw new ApplicationException(new RemoveException("Session objects are private resources and do not have primary keys"));
}
项目:tomee    文件:SingletonEJBHomeHandler.java   
@Override
protected Object removeByPrimaryKey(final Method method, final Object[] args, final Object proxy) throws Throwable {
    throw new ApplicationException(new RemoveException("Session objects are private resources and do not have primary keys"));
}
项目:tomee    文件:LicenseBean.java   
public void ejbRemove() throws RemoveException {
}
项目:tomee    文件:PersonBean.java   
public void ejbRemove() throws RemoveException {
}
项目:tomee    文件:PlatformBean.java   
public void ejbRemove() throws RemoveException {
}
项目:tomee    文件:GameBean.java   
public void ejbRemove() throws RemoveException {
}
项目:tomee    文件:SongBean.java   
public void ejbRemove() throws RemoveException {
}
项目:tomee    文件:ArtistBean.java   
public void ejbRemove() throws RemoveException {
}
项目:tomee    文件:StatefulEjbHomeHandler.java   
protected Object removeByPrimaryKey(final Class interfce, final Method method, final Object[] args, final Object proxy) throws Throwable {
    throw new RemoveException("Session objects are private resources and do not have primary keys");
}
项目:tomee    文件:ManagedHomeHandler.java   
protected Object removeByPrimaryKey(final Class interfce, final Method method, final Object[] args, final Object proxy) throws Throwable {
    throw new RemoveException("Session objects are private resources and do not have primary keys");
}
项目:tomee    文件:StatelessEjbHomeHandler.java   
@Override
protected Object removeByPrimaryKey(final Class interfce, final Method method, final Object[] args, final Object proxy) throws Throwable {
    throw new RemoveException("Session objects are private resources and do not have primary keys");
}
项目:tomee    文件:CmpContainer.java   
@Override
public void ejbRemove(final EntityBean entity) throws RemoveException {
    CmpContainer.this.ejbRemove(entity);
}
项目:tomee    文件:SingletonEjbHomeHandler.java   
protected Object removeByPrimaryKey(final Class interfce, final Method method, final Object[] args, final Object proxy) throws Throwable {
    throw new RemoveException("Session objects are private resources and do not have primary keys");
}
项目:tomee    文件:ABean.java   
public void ejbRemove() throws RemoveException {
}
项目:tomee    文件:BBean.java   
public void ejbRemove() throws RemoveException {
}
项目:tomee    文件:ABean.java   
public void ejbRemove() throws RemoveException {
}
项目:tomee    文件:BBean.java   
public void ejbRemove() throws RemoveException {
}
项目:tomee    文件:ABean.java   
public void ejbRemove() throws RemoveException {
}
项目:tomee    文件:BBean.java   
public void ejbRemove() throws RemoveException {
}
项目:tomee    文件:ABean.java   
public void ejbRemove() throws RemoveException {
}
项目:tomee    文件:CheckNoCreateMethodsTest.java   
@Override
public void ejbRemove() throws RemoveException, EJBException, RemoteException {
}
项目:tomee    文件:CheckNoCreateMethodsTest.java   
@Override
public void ejbRemove() throws RemoveException, EJBException, RemoteException {
}