public void entityActivated() throws ResourceException { logger.debug("TTSResourceAdaptor.entityActivated() called."); try { logger.debug("Starting "); try { raProvider = new TTSProviderImpl(this); initializeNamingContext(); } catch (Exception ex) { logger .error("TTSResourceAdaptor.start(): Exception caught! "); ex.printStackTrace(); throw new ResourceException(ex.getMessage()); } activities = new HashMap(); } catch (ResourceException e) { e.printStackTrace(); throw new javax.slee.resource.ResourceException( "TTSResourceAdaptor.entityActivated(): Failed to activate TTS Resource Adaptor!", e); } }
/** * Gets the value of the specified configuration property. * * @param propertyDescriptor the description of the property. * @return the value of the property specified by descriptor. */ public Object getConfigProperty(ConfigPropertyDescriptor propertyDescriptor) throws ResourceException { String methodName = accessorName("get", propertyDescriptor.getName()); Class[] signature = new Class[]{}; Method method; try { method = resourceAdaptor.getClass().getMethod(methodName, signature); } catch (SecurityException ex) { throw new ResourceException(ex.getMessage()); } catch (NoSuchMethodException ex) { throw new ResourceException(resourceAdaptor.getClass() + " should implement property accessor method " + propertyDescriptor.getType() + " " + methodName + "()"); } try { return method.invoke(resourceAdaptor, new Object[]{}); } catch (Exception ex) { throw new ResourceException("Failed to get value of " + name + ". Caused by " + ex.getMessage()); } }
e.printStackTrace(); throw new ManagementException(e.getMessage());
private void reactivateResourceAdaptors() { HashMap<String, ResourceAdaptorEntity> map = sleeContainer .getResourceAdaptorEntities(); ArrayList<String> activated = new ArrayList<String>(); for (String entityName : this.activeRAEntities) { ResourceAdaptorEntity entity = map.get(entityName); if (entity != null) { try { entity.activate(); } catch (ResourceException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidStateException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else { // errror... ;/ } // this.activeRAEntities.remove(entityName); activated.add(entityName); } this.activeRAEntities.removeAll(activated); }
public void start() throws ResourceException { // TODO Auto-generated method stub try { log.info("Login to " + this.MAGIIP + " with " + this.MAGILogin + " " + this.MAGIPassword); managerConnection.login(); log.debug("Asterisk Resource Adaptor started."); initializeNamingContext(); } catch (Exception ex) { ex.printStackTrace(); throw new ResourceException(ex.getMessage()); } sbbInterface = new AsteriskRASbbInterfaceImpl(); activities = new HashMap(); state = ResourceAdaptorState.ACTIVE; }
public void entityActivated() throws ResourceException { // TODO Auto-generated method stub try { try { this.configure(null); } catch (InvalidStateException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } this.start(); } catch (ResourceException e) { e.printStackTrace(); throw new javax.slee.resource.ResourceException("Failed to Activate Resource Adaptor!", e); } }
method = resourceAdaptor.getClass().getMethod(methodName, signature); } catch (SecurityException ex) { throw new ResourceException(ex.getMessage()); } catch (NoSuchMethodException ex) { throw new ResourceException(resourceAdaptor.getClass() + " should implement property accessor method " + methodName + "(" + propertyDescriptor.getType() + ")"); method.invoke(resourceAdaptor, args); } catch (Exception ex) { throw new ResourceException("Failed to set " + value + " to " + name + ". Caused by " + ex.getMessage());
public void start() throws ResourceException { try { TCKResourceTestInterface testInterface = tckResourceSetup.getTestInterface(); SleeContainer slee = SleeContainer.lookupFromJndi(); int port = slee.getRmiRegistryPort(); Registry rmiRegistry = LocateRegistry.getRegistry(port); Class tcktest = Thread.currentThread().getContextClassLoader().loadClass("com.opencloud.sleetck.lib.resource.impl.TCKResourceTestInterfaceImpl"); rmiRegistry.rebind("TCKResourceTestInterface", testInterface); log.debug("bound TCKResourceTestInterface"); } catch (Exception e) { throw new ResourceException("Error binding test interface", e); } try { this.tckResourceAdaptor.addEventHandler(eventHandler); } catch (RemoteException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
throw new ResourceException("Failed to lookup facilities due to:\n",e1); new ResourceException("Resource exception ");
logger.debug("There is no ac associated with given acID[" + nullACID + "]!!"); throw new ResourceException("Can not find AC for given ID[" + nullACID + "], try again!!!");
logger.debug("Ac retrieval failed, no such ac[" + AC_ID + "]!!!"); throw new ResourceException( "Activity Context does not exist (ACID[" + AC_ID + "]), try another one!!");