本文整理汇总了Java中javax.ejb.RemoveException类的典型用法代码示例。如果您正苦于以下问题:Java RemoveException类的具体用法?Java RemoveException怎么用?Java RemoveException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RemoveException类属于javax.ejb包,在下文中一共展示了RemoveException类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: cleanUp
import javax.ejb.RemoveException; //导入依赖的package包/类
/**
* 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);
}
}
开发者ID:qoswork,项目名称:opennmszh,代码行数:19,代码来源:AlarmListJ2eeConnectionManagerThread.java
示例2: ejbRemove
import javax.ejb.RemoveException; //导入依赖的package包/类
/**
* 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);
}
}
开发者ID:apache,项目名称:tomee,代码行数:32,代码来源:BasicBmp2DataSourcesBean.java
示例3: ejbRemove
import javax.ejb.RemoveException; //导入依赖的package包/类
/**
* 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);
}
}
开发者ID:apache,项目名称:tomee,代码行数:32,代码来源:BasicBmpBean.java
示例4: beforeDelete
import javax.ejb.RemoveException; //导入依赖的package包/类
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);
}
}
开发者ID:apache,项目名称:tomee,代码行数:10,代码来源:JpaCmpEngine.java
示例5: ejbRemove
import javax.ejb.RemoveException; //导入依赖的package包/类
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);
}
}
开发者ID:apache,项目名称:tomee,代码行数:29,代码来源:CmpContainer.java
示例6: ejbRemove
import javax.ejb.RemoveException; //导入依赖的package包/类
@Override
public void ejbRemove() throws RemoveException, EJBException, RemoteException {
logger.info("ejbRemove");
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:5,代码来源:Topic.java
示例7: remove
import javax.ejb.RemoveException; //导入依赖的package包/类
@Override
public void remove() throws RemoteException, RemoveException {
logger.info("remove");
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:5,代码来源:Ejb21EngineRemoteBean.java
示例8: remove
import javax.ejb.RemoveException; //导入依赖的package包/类
@Override
public void remove() throws RemoveException, EJBException {
logger.info("remove");
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:5,代码来源:Ejb21StateEngineLocalBean.java
示例9: DeleteEntry
import javax.ejb.RemoveException; //导入依赖的package包/类
@Override
protected void DeleteEntry(Property p) throws RemoveException {
home.remove(new ProfilePropertyPK(profilename, p.getName()));
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:5,代码来源:ProfilePropertySet.java
示例10: DeleteEntry
import javax.ejb.RemoveException; //导入依赖的package包/类
@Override
protected void DeleteEntry(ServiceProperty p) throws RemoveException {
home.remove(new ServicePropertyPK(Serviceid, p.getName()));
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:5,代码来源:ServicePropertySet.java
示例11: DeleteEntry
import javax.ejb.RemoveException; //导入依赖的package包/类
@Override
protected void DeleteEntry(Property p) throws RemoveException {
//System.out.println ("HostPropertySet::DeleteEntry "+hostid+" "+p.getName());
home.remove(new HostPropertyPK(hostid, p.getName()));
}
开发者ID:navisidhu,项目名称:libreacs,代码行数:6,代码来源:HostPropertySet.java
示例12: removeByPrimaryKey
import javax.ejb.RemoveException; //导入依赖的package包/类
@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"));
}
开发者ID:apache,项目名称:tomee,代码行数:5,代码来源:StatelessEJBHomeHandler.java
示例13: ejbRemove
import javax.ejb.RemoveException; //导入依赖的package包/类
public void ejbRemove() throws RemoveException {
}
开发者ID:apache,项目名称:tomee,代码行数:3,代码来源:LicenseBean.java
示例14: removeByPrimaryKey
import javax.ejb.RemoveException; //导入依赖的package包/类
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");
}
开发者ID:apache,项目名称:tomee,代码行数:4,代码来源:StatefulEjbHomeHandler.java
示例15: removeByPrimaryKey
import javax.ejb.RemoveException; //导入依赖的package包/类
@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");
}
开发者ID:apache,项目名称:tomee,代码行数:5,代码来源:StatelessEjbHomeHandler.java
示例16: ejbRemove
import javax.ejb.RemoveException; //导入依赖的package包/类
@Override
public void ejbRemove() throws RemoveException, EJBException, RemoteException {
}
开发者ID:apache,项目名称:tomee,代码行数:4,代码来源:CheckNoCreateMethodsTest.java
注:本文中的javax.ejb.RemoveException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论