List of usage examples for java.rmi RemoteException RemoteException
public RemoteException(String s, Throwable cause)
From source file:edu.clemson.cs.nestbed.server.management.profiling.MoteMessageManager.java
@SuppressWarnings("unchecked") public void addMessageObserver(int pmsID, RemoteObserver observer) throws RemoteException { log.info("Adding a message observer for moteID: " + mote.getID() + " for message id: " + pmsID); ProgramMessageSymbol pms;/*from w w w. ja v a 2 s .co m*/ List<RemoteObserver> observers; pms = ProgramMessageSymbolManagerImpl.getInstance().getProgramMessageSymbol(pmsID); observers = messageObserverListMap.get(pms); if (observers == null) { observers = new ArrayList<RemoteObserver>(); messageObserverListMap.put(pms, observers); } try { observers.add(observer); Class c = pms.getMessageClass(); Constructor constructor = c.getConstructor(); Message msg = (Message) constructor.newInstance(); moteIF.registerListener(msg, this); } catch (Exception ex) { observers.remove(observer); String msg = "Cannot create message type object: "; log.error(msg, ex); throw new RemoteException(msg, ex); } }
From source file:edu.clemson.cs.nestbed.server.management.configuration.ProgramSymbolManagerImpl.java
public List<ProgramSymbol> getProgramSymbols(int programID) throws RemoteException { log.debug("getProgramSymbols() called."); List<ProgramSymbol> programSymbolList; programSymbolList = new ArrayList<ProgramSymbol>(); readLock.lock();/*from w w w . j a va2 s.c om*/ try { for (ProgramSymbol i : programSymbols.values()) { if (i.getProgramID() == programID) { programSymbolList.add(i); } } } catch (Exception ex) { String msg = "Exception in getProgramSymbols"; log.error(msg, ex); throw new RemoteException(msg, ex); } finally { readLock.unlock(); } return programSymbolList; }
From source file:gov.nih.nci.cagrid.identifiers.service.IdentifiersNAServiceImpl.java
public IdentifiersNAServiceImpl() throws RemoteException { super();/* w ww. j a v a 2s . c o m*/ try { String naConfigurationFile = getConfiguration().getNaConfigurationFile(); String naProperties = getConfiguration().getNaPropertiesFile(); FileSystemResource naConfResource = new FileSystemResource(naConfigurationFile); FileSystemResource naPropertiesResource = new FileSystemResource(naProperties); XmlBeanFactory factory = new XmlBeanFactory(naConfResource); PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer(); cfg.setLocation(naPropertiesResource); cfg.postProcessBeanFactory(factory); this.namingAuthority = (MaintainerNamingAuthority) factory.getBean(NA_BEAN_NAME, MaintainerNamingAuthority.class); } catch (Exception e) { String message = "Problem inititializing NamingAuthority while loading configuration:" + e.getMessage(); LOG.error(message, e); throw new RemoteException(message, e); } }
From source file:gridool.GridServer.java
private <A extends Serializable, R extends Serializable> R execute( @Nonnull Class<? extends GridJob<A, R>> jobClass, @Nullable A arg, @Nonnull String deploymentGroup) throws RemoteException { final GridJobFuture<R> future = kernel.execute(jobClass, arg, deploymentGroup); try {// w ww .ja va 2s. c o m return future.get(); } catch (InterruptedException e) { LOG.error(e.getMessage(), e); throw new RemoteException(e.getMessage(), e); } catch (ExecutionException e) { LOG.error(e.getMessage(), e); throw new RemoteException(e.getMessage(), e); } }
From source file:edu.clemson.cs.nestbed.server.management.configuration.MoteDeploymentConfigurationManagerImpl.java
public MoteDeploymentConfiguration getMoteDeploymentConfigurationByProgramID(int moteID, int programID) throws RemoteException { MoteDeploymentConfiguration mdc = null; readLock.lock();// w w w . jav a 2s.c om try { for (MoteDeploymentConfiguration i : moteDepConfigs.values()) { if ((i.getMoteID() == moteID) && (i.getProgramID() == programID)) { mdc = i; break; } } } catch (Exception ex) { String msg = "Exception in getMoteDeploymentConfigurationByProgramID"; log.error(msg, ex); throw new RemoteException(msg, ex); } finally { readLock.unlock(); } return mdc; }
From source file:edu.clemson.cs.nestbed.server.management.configuration.ProjectDeploymentConfigurationManagerImpl.java
public List<ProjectDeploymentConfiguration> getProjectDeploymentConfigs(int projectID) throws RemoteException { log.debug("getProjectDeploymentConfigs() called"); List<ProjectDeploymentConfiguration> configList; configList = new ArrayList<ProjectDeploymentConfiguration>(); readLock.lock();/* w w w. jav a2 s .com*/ try { for (ProjectDeploymentConfiguration i : projDepConfigs.values()) { if (i.getProjectID() == projectID) { configList.add(i); } } } catch (Exception ex) { String msg = "Exception in getProjectDeploymentConfigs"; log.error(msg, ex); throw new RemoteException(msg, ex); } finally { readLock.unlock(); } return configList; }
From source file:edu.clemson.cs.nestbed.server.management.configuration.MoteTestbedAssignmentManagerImpl.java
public MoteTestbedAssignment getMoteTestbedAssignment(int moteID) throws RemoteException { MoteTestbedAssignment mtba = null;// w w w . j a va 2 s. c om readLock.lock(); try { for (MoteTestbedAssignment i : moteTestbedAssignments.values()) { if (i.getMoteID() == moteID) { mtba = i; break; } } } catch (Exception ex) { String msg = "Exception in getMoteTestbedAssignment"; log.error(msg, ex); throw new RemoteException(msg, ex); } finally { readLock.unlock(); } return mtba; }
From source file:edu.duke.cabig.c3pr.rules.deploy.RuleDeploymentServiceImpl.java
public void registerRuleSet(String bindUri, String ruleSetName) throws RemoteException, RuleException { rc.ruleSetDeployed(bindUri);/*from w ww . j a v a 2s .com*/ rc.ruleSetModified(bindUri); // obtain the rule xml from repository RuleSet ruleSet = getRepositoryService().getRuleSet(ruleSetName, false); // transform the rule xml to a Package , then register the Package to rule exceution service try { RuleAdapter ruleAdapter = null; ruleAdapter = (RuleAdapter) Class .forName("edu.duke.cabig.c3pr.rules.common.adapter.CaAERSJBossXSLTRuleAdapter").newInstance(); Object ruleSetObj = ruleAdapter.adapt(ruleSet); registerPackage(bindUri, ruleSetObj); } catch (Exception e) { log.info("Error while registering ruleSet, with name :" + ruleSetName + ", bindUri :" + bindUri, e); throw new RemoteException(e.getMessage(), e); } rc.putRuleSet(bindUri, ruleSet); }
From source file:edu.clemson.cs.nestbed.server.management.configuration.ProgramMessageSymbolManagerImpl.java
public List<ProgramMessageSymbol> getProgramMessageSymbols(int programID) throws RemoteException { log.debug("getProgramMessageSymbols() called"); List<ProgramMessageSymbol> programMessageSymbolList; programMessageSymbolList = new ArrayList<ProgramMessageSymbol>(); readLock.lock();/*from w w w. ja v a2s . co m*/ try { for (ProgramMessageSymbol i : programMessageSymbols.values()) { if (i.getProgramID() == programID) { programMessageSymbolList.add(i); } } } catch (Exception ex) { String msg = "Exception in getProgramMessageSymbols"; log.error(msg, ex); throw new RemoteException(msg, ex); } finally { readLock.unlock(); } return programMessageSymbolList; }