public ComponentInvocation getCurrentInvocation() { return _invManager.getCurrentInvocation(); }
private boolean inFinder() { boolean inFinder = false; ComponentInvocation ci = container.invocationManager.getCurrentInvocation(); if ( ci instanceof EjbInvocation ) { EjbInvocation inv = (EjbInvocation) ci; Method currentMethod = inv.method; inFinder = ( (currentMethod != null) && inv.isHome && currentMethod.getName().startsWith("find") ); } return inFinder; }
protected ComponentInvocation getCurrentComponentInvocation() { BaseContainer container = (BaseContainer) getContainer(); return container.invocationManager.getCurrentInvocation(); }
protected ComponentInvocation getCurrentComponentInvocation() { BaseContainer container = (BaseContainer) getContainer(); return container.invocationManager.getCurrentInvocation(); }
public void setTransactionCompeting(boolean b) { ComponentInvocation curr = invMgr.getCurrentInvocation(); if (curr != null) curr.setTransactionCompeting(b); }
ComponentInvocation getCurrentInvocation() { ServiceLocator serviceLocator = Globals.getDefaultHabitat(); InvocationManager invocationManager = serviceLocator == null ? null : serviceLocator.getService(InvocationManager.class); return invocationManager == null ? null : invocationManager.getCurrentInvocation(); }
public ResourceInjectorImpl(WebServiceEndpoint ep) { WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance(); invMgr = wscImpl.getInvocationManager(); inv = invMgr.getCurrentInvocation(); endpoint = ep; }
@Override public String getCurrentTag() { ComponentInvocation compInv = invocationManager.getCurrentInvocation(); return compInv == null ? null : (config.getName() + ":" + compInv.getAppName()); }
public MessageContext getMessageContext() { InvocationManager invManager = EjbContainerUtilImpl.getInstance().getInvocationManager(); try { ComponentInvocation inv = invManager.getCurrentInvocation(); if ((inv != null) && isWebServiceInvocation(inv)) { return ((EjbInvocation) inv).messageContext; } else { throw new IllegalStateException("Attempt to access " + "MessageContext outside of a web service invocation"); } } catch (Exception e) { IllegalStateException ise = new IllegalStateException(); ise.initCause(e); throw ise; } }
public void unregisterComponentResource(TransactionalResource h) { if(_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "\n\nIn JavaEETransactionManagerSimplified.unregisterComponentResource, h=" + h + " h.xares=" + h.getXAResource()); } Object instance = h.getComponentInstance(); if (instance == null) return; h.setComponentInstance(null); ComponentInvocation inv = invMgr.getCurrentInvocation(); List l = getExistingResourceList(instance, inv); if (l != null) { l.remove(h); } }
private ComponentInvocation getCurrentComponentInvocation() { return ConnectorRuntime.getRuntime().getInvocationManager().getCurrentInvocation(); }
public void registerComponentResource(TransactionalResource h) { ComponentInvocation inv = invMgr.getCurrentInvocation(); if (inv != null) { Object instance = inv.getInstance(); if (instance == null) return; h.setComponentInstance(instance); List l = getResourceList(instance, inv); if(_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "\n\nIn JavaEETransactionManagerSimplified.registerComponentResource, h=" + h + " h.xares=" + h.getXAResource()); } l.add(h); } }
public EntityManager lookupExtendedEntityManager(EntityManagerFactory emf) { EntityManager em = null; ComponentInvocation inv = invMgr.getCurrentInvocation(); if( (inv != null) && (inv.getInvocationType() == ComponentInvocation.ComponentInvocationType.EJB_INVOCATION )) { Object obj = inv.getContainer(); if (obj instanceof JavaEEContainer) { em = ((JavaEEContainer) obj).lookupExtendedEntityManager(emf); } } return em; }
/** * Returns the component invoking resource request. * * @return Handle to the component. */ public Object getComponent(){ InvocationManager invmgr = ConnectorRuntime.getRuntime().getInvocationManager(); ComponentInvocation inv = invmgr.getCurrentInvocation(); if (inv == null) { return null; } return inv.getInstance(); }
private void checkUserTransactionLookupAllowed() throws NamingException { InvocationManager iv = habitat.getService(InvocationManager.class); if (iv != null) { ComponentInvocation inv = iv.getCurrentInvocation(); if (inv != null) { TransactionOperationsManager toMgr = (TransactionOperationsManager)inv.getTransactionOperationsManager(); if ( toMgr != null ) { toMgr.userTransactionLookupAllowed(); } } } } }
public boolean handleRequest(MessageContext context) { EJBInvocation inv = null; try { WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance(); InvocationManager invManager = wscImpl.getInvocationManager(); inv = (EJBInvocation) invManager.getCurrentInvocation(); Method method = wsUtil.getInvMethod( (com.sun.xml.rpc.spi.runtime.Tie)inv.getWebServiceTie(), context); inv.setWebServiceMethod(method); if ( !inv.authorizeWebService(method) ) { throw new Exception( format( rb.getString ("client.unauthorized") , method.toString())); } } catch(Exception e) { wsUtil.throwSOAPFaultException(e.getMessage(), context); } return true; }
public void setRollbackOnly() throws IllegalStateException, SystemException { if (!initialized) init(); if (userTx != null) { userTx.setRollbackOnly(); return; } ComponentInvocation inv = invocationManager.getCurrentInvocation(); if (inv != null) { checkUserTransactionMethodAccess(inv); } transactionManager.setRollbackOnly(); }
public void setTransactionTimeout(int seconds) throws SystemException { if (!initialized) init(); if (userTx != null) { userTx.setTransactionTimeout(seconds); return; } ComponentInvocation inv = invocationManager.getCurrentInvocation(); if (inv != null) { checkUserTransactionMethodAccess(inv); } transactionManager.setTransactionTimeout(seconds); }
public int getStatus() throws SystemException { if (!initialized) init(); if (userTx != null) { return userTx.getStatus(); } ComponentInvocation inv = invocationManager.getCurrentInvocation(); if (inv != null) { checkUserTransactionMethodAccess(inv); } return transactionManager.getStatus(); }
public boolean isCurrentModuleJCDIEnabled() { BundleDescriptor bundle = null; ComponentInvocation inv = invocationManager.getCurrentInvocation(); if( inv == null ) { return false; } JndiNameEnvironment componentEnv = compEnvManager.getJndiNameEnvironment(inv.getComponentId()); if( componentEnv != null ) { if( componentEnv instanceof BundleDescriptor ) { bundle = (BundleDescriptor) componentEnv; } else if( componentEnv instanceof EjbDescriptor ) { bundle = ((EjbDescriptor) componentEnv).getEjbBundleDescriptor(); } } return (bundle != null) ? isJCDIEnabled(bundle) : false; }