/** * Using Singleton pattern * * @return */ public static synchronized SleeProfileManager getInstance() { if (sleeProfileManager == null) throw new SLEEException("Access attempted before initialization of " + SleeProfileManager.class.getName()); return sleeProfileManager; }
private void doGeneralChecks() { if (this.profileTable == null) throw new SLEEException("Profile table has not been set."); if (this.profileTable.getProfileTableNotification() == null) throw new SLEEException("Profile table has no notification source."); }
public ObjectName getSleeManagementMBean() { try { return new ObjectName(SleeManagementMBean.OBJECT_NAME); } catch (Throwable e) { throw new SLEEException(e.getMessage(),e); } }
public ProfileObjectImpl borrowObject() throws SLEEException { ProfileObjectImpl obj = null; try { obj = (ProfileObjectImpl) pool.borrowObject(); } catch (Throwable e) { throw new SLEEException(e.getMessage(),e); } if (logger.isTraceEnabled()) { logger.trace("borrowed object "+obj + " from " + this); } return obj; }
public void invalidateObject(ProfileObject obj) { try { pool.invalidateObject(obj); } catch (Exception e) { throw new SLEEException(e.getMessage(),e); } if (logger.isTraceEnabled()) { logger.trace("invalidated object "+obj + " to " + this); } } }
/** * */ public void unregisterUsageMBean() { if (this.profileTableUsageMBean != null) { try { this.profileTableUsageMBean.remove(); } catch (Throwable e) { throw new SLEEException(e.getMessage(),e); } } }
private ProfileTableImpl createProfileTableInstance(String profileTableName, ProfileSpecificationComponent component) { if (component.getProfileTableConcreteClass() == null) { return new ProfileTableImpl(profileTableName, component, this); } else { try { return (ProfileTableImpl)component.getProfileTableConcreteClass().getConstructor(String.class, ProfileSpecificationComponent.class, ProfileManagementImpl.class).newInstance(profileTableName, component, this); } catch (Throwable e) { throw new SLEEException(e.getMessage(),e); } } }
public String getProfileTableName() throws SLEEException { doGeneralChecks(); try { return this.profileTable.getProfileTableName(); } catch (Exception e) { throw new SLEEException("Operaion failed.", e); } }
public boolean getRollbackOnly() throws TransactionRequiredLocalException, SLEEException { SleeTransactionManager txMgr = sleeContainer.getTransactionManager(); txMgr.mandateTransaction(); if (logger.isDebugEnabled()) { logger.debug("in getRollbackOnly on " + this); } try { return txMgr.getRollbackOnly(); } catch (SystemException e) { throw new SLEEException("Problem with the tx manager!"); } }
@Override public void sleeRunning() { if (sleeContainer.getCluster(CacheType.ACTIVITIES).isHeadMember()) { try { startActiveServicesActivities(); } catch (Throwable e) { throw new SLEEException(e.getMessage(), e); } } }
public DeployableUnitDescriptorImpl parse(InputStream inputStream) throws DeploymentException { Object jaxbPojo = buildJAXBPojo(inputStream); if (jaxbPojo instanceof org.mobicents.slee.container.component.deployment.jaxb.slee11.du.DeployableUnit) { return new DeployableUnitDescriptorImpl((org.mobicents.slee.container.component.deployment.jaxb.slee11.du.DeployableUnit)jaxbPojo); } else if (jaxbPojo instanceof org.mobicents.slee.container.component.deployment.jaxb.slee.du.DeployableUnit) { return new DeployableUnitDescriptorImpl((org.mobicents.slee.container.component.deployment.jaxb.slee.du.DeployableUnit)jaxbPojo); } else { throw new SLEEException("unexpected class of jaxb pojo built: "+(jaxbPojo != null ? jaxbPojo.getClass() : null)); } } }
public void checkReEntrant() throws SLEEException { try { if ((!this.getSbbDescriptor().isReentrant()) && this.transaction == SleeContainer .getTransactionManager().getTransaction()) throw new SLEEException(" re-entrancy not allowed "); } catch (SystemException ex) { throw new RuntimeException("Transaction Manager exception while checkReEntrant!",ex); } }
public ProfileLocalObjectImpl(ProfileObjectImpl profileObject) { this.profileObject = profileObject; try { this.transaction = sleeContainer.getTransactionManager().getTransaction(); this.profileName = profileObject.getProfileEntity().getProfileName(); } catch (Throwable e) { throw new SLEEException(e.getMessage(),e); } }
public void setRollbackOnly() throws TransactionRequiredLocalException, SLEEException { final SleeTransactionManager sleeTransactionManager = sleeContainer .getTransactionManager(); sleeTransactionManager.mandateTransaction(); try { sleeTransactionManager.setRollbackOnly(); } catch (SystemException e) { throw new SLEEException("failed to mark tx for rollback", e); } }
public void reconfig() { for (String key : pools.keySet()) { ProfileTableImpl profileTable; try { profileTable = (ProfileTableImpl) sleeContainer.getSleeProfileTableManager().getProfileTable(key); } catch (UnrecognizedProfileTableNameException e) { throw new SLEEException(e.getMessage(),e); } createObjectPool(profileTable); } }
public boolean getRollbackOnly() throws TransactionRequiredLocalException, SLEEException { SleeContainer.getTransactionManager().mandateTransaction(); if (logger.isDebugEnabled()) { logger.debug("in getRollbackOnly on " + this); } try { return SleeContainer.getTransactionManager().getRollbackOnly(); } catch (SystemException e) { throw new SLEEException ("Problem with the tx manager!" ); } }
@Override public NotificationSourceWrapperImpl getNotificationSource() { final ServiceComponent serviceComponent = SleeContainer.lookupFromJndi().getComponentRepository().getComponentByID(SleeThreadLocals.getInvokingService()); if (serviceComponent != null) { return (NotificationSourceWrapperImpl) serviceComponent.getAlarmNotificationSources().get(sbbID); } else { throw new SLEEException("unable to retrieve notification source for sbb, the service was not found"); } }
public void setRollbackOnly() throws TransactionRequiredLocalException, SLEEException { doGeneralChecks(); final SleeTransactionManager txMgr = profileTable.getSleeContainer() .getTransactionManager(); txMgr.mandateTransaction(); try { txMgr.setRollbackOnly(); } catch (SystemException e) { throw new SLEEException("Problem with the tx manager!"); } }
public boolean getRollbackOnly() throws TransactionRequiredLocalException, SLEEException { doGeneralChecks(); final SleeTransactionManager txMgr = profileTable.getSleeContainer() .getTransactionManager(); txMgr.mandateTransaction(); try { return txMgr.getRollbackOnly(); } catch (SystemException e) { throw new SLEEException("Problem with the tx manager!"); } }
private boolean isPrimitiveOrPrimitiveArray(CtClass ctClass) { if (ctClass.isArray()) { try { return ctClass.getComponentType().isPrimitive(); } catch (NotFoundException e) { throw new SLEEException(e.getMessage(), e); } } else { return ctClass.isPrimitive(); } }