List of usage examples for java.rmi RemoteException RemoteException
public RemoteException(String s)
From source file:org.slc.sli.ingestion.util.LogUtilTest.java
@Test public void testLogUtil() { // Log a nested exception. final Logger mockLogger = Mockito.mock(Logger.class); Mockito.when(mockLogger.isErrorEnabled()).thenReturn(true); try {/*from ww w .j a va 2 s . co m*/ throw new RemoteException("*** EXCEPTION MESSAGE ONE!!! ***"); } catch (RemoteException re1) { try { throw new RuntimeException("*** EXCEPTION MESSAGE TWO!!! ***", re1); } catch (RuntimeException re2) { try { throw new AccessException("*** EXCEPTION MESSAGE THREE!!! ***", re2); } catch (AccessException ae) { String message = "This is a test of the LogUtil utility"; // Now test what would be logged. // First, without exception local message logging. LogUtil.setIncludeExceptionMessage(false); LogUtil.error(mockLogger, message, ae); Mockito.verify(mockLogger).error(Mockito.eq(message), Mockito.argThat(new IsCorrectException())); // Next, with exception local message logging. LogUtil.setIncludeExceptionMessage(true); LogUtil.error(mockLogger, message, ae); Mockito.verify(mockLogger).error(Mockito.eq(message), Mockito.argThat(new IsCorrectException())); } } } }
From source file:edu.duke.cabig.c3pr.rules.deploy.RuleDeploymentServiceImpl.java
public void login(String userName, String password) throws RemoteException { throw new RemoteException("Not Implemented"); }
From source file:edu.duke.cabig.c3pr.rules.deploy.RuleDeploymentServiceImpl.java
/** * Read this configuration and make sure we have a JCR Repository implementation to support * that.// w ww . ja v a2s . com * * @throws RemoteException */ public void configureRepository(RepositoryConfiguration repositoryConfiguration) throws RemoteException { throw new RemoteException("Not Implemented"); }
From source file:edu.cornell.med.icb.R.RConfigurationServer.java
public RConfigurationItem borrowConfigurationItem() throws RemoteException { final RConfigurationItem item; try {//w ww. ja va2 s. c o m item = configurations.takeFirst(); if (LOG.isDebugEnabled()) { LOG.debug("Giving out: " + item.getHost() + ":" + item.getPort()); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RemoteException(e.getMessage()); } return item; }
From source file:com.urbancode.ud.client.ProcessClient.java
public String getGenericProcessResult(String processID, int timeoutInMinutes) throws IOException, JSONException, InterruptedException, RemoteException { String result = ""; String workflowTraceID = getWorkflowTraceID(processID); String uri = url + "/rest/workflow/workflowTrace/" + encodePath(workflowTraceID); HttpGet method = new HttpGet(uri); HttpResponse response = invokeMethod(method); long pollInterval = 1000L; long timeoutInterval = timeoutInMinutes * 60L * 1000L; long start = System.currentTimeMillis(); boolean found = false; while (!found) { if (System.currentTimeMillis() - start > timeoutInterval) { throw new RemoteException("Timeout waiting for generic process to finish"); }/*from ww w. ja v a 2 s. c o m*/ discardBody(response); Thread.sleep(pollInterval); method = new HttpGet(uri); response = invokeMethod(method); String body = getBody(response); JSONObject jsonResult = new JSONObject(body); JSONObject rootActivity = (JSONObject) jsonResult.get("rootActivity"); String workflowStatus = (String) rootActivity.get("state"); if (workflowStatus.equalsIgnoreCase("CLOSED") || workflowStatus.equalsIgnoreCase("COMPLETED")) { result = (String) jsonResult.get("result"); found = true; } } return result; }
From source file:edu.cornell.med.icb.R.RConfigurationServer.java
/** * Get a configuration for an Rserve instance. If no items are available at the moment, this * method will wait up to the specified wait time for a configuration to become available. * * @param timeout how long to wait before giving up, in units of <tt>unit</tt> * @param unit a <tt>TimeUnit</tt> determining how to interpret the <tt>timeout</tt> parameter * @return A valid object or null if no connection was available within the timeout period *//*from w w w. j a v a 2 s. c o m*/ public RConfigurationItem borrowConfigurationItem(final long timeout, final TimeUnit unit) throws RemoteException { RConfigurationItem item = null; try { item = configurations.pollFirst(timeout, unit); } catch (InterruptedException e) { LOG.warn("Interrupted", e); Thread.currentThread().interrupt(); throw new RemoteException(e.getMessage()); } return item; }
From source file:gov.nih.nci.caarray.services.external.v1_0.grid.service.CaArraySvc_v1_0Impl.java
private synchronized CaArrayServer getCaArrayServer() throws RemoteException { if (caArrayServer == null) { try {//from w w w .jav a 2 s. co m String jndiUrl = getJndiUrl(); if (jndiUrl == null) { throw new RemoteException("Could not connect to server: invalid JNDI configuration"); } CaArrayServer s = new CaArrayServer(jndiUrl); s.connect(); caArrayServer = s; } catch (IOException e) { throw new RemoteException("Could not connect to server", e); } catch (ServerConnectionException e) { throw new RemoteException("Could not connect to server", e); } } return caArrayServer; }
From source file:edu.northwestern.bioinformatics.studycalendar.grid.PSCAdverseEventConsumer.java
public void register(final AENotificationType aeNotification) throws java.rmi.RemoteException, InvalidRegistration, RegistrationFailed { // Check for Role // 1. If Assigned Role is AE_REPORTER, then process, otherwise Access Denied. SuiteRoleMembership suiteRoleMembership = getUserSuiteRoleMembership(); if (suiteRoleMembership == null) { logger.error("Access Denied: user does not have AE_REPORTER role"); throw new RemoteException("Access Denied: user does not have AE_REPORTER role"); }/*from w w w. j a v a2 s . co m*/ // TODO: Change fault implementation to accept a reason message. String gridId = aeNotification.getRegistrationGridId(); if (gridId == null) { logger.error("No registrationGridId provided"); throw new InvalidRegistration(); } // get the StudySubjectAssignment StudySubjectAssignment studySubjectAssignment = studySubjectAssignmentDao.getByGridId(gridId); if (studySubjectAssignment == null) { logger.error("Invalid Registration GridId provided"); throw new InvalidRegistration(); } StudySite studySite = studySubjectAssignment.getStudySite(); Study study = studySite.getStudy(); String studyAssignedIdentifier = study.getAssignedIdentifier(); // Authorization for study if (!authorizedStudyIdentifier(studyAssignedIdentifier, suiteRoleMembership)) { String message = "Access Denied: AE_REPORTER is not authorized for this Study Identifier : " + studyAssignedIdentifier; logger.error(message); throw new RemoteException(message); } Site site = studySite.getSite(); String siteAssignedIdentifier = site.getAssignedIdentifier(); // Authorization for site if (!authorizedSiteIdentifier(siteAssignedIdentifier, suiteRoleMembership)) { String message = "Access Denied: AE_REPORTER is not authorized for this Site Identifier : " + siteAssignedIdentifier; logger.error(message); throw new RemoteException(message); } String description = aeNotification.getDescription(); if (description == null) { logger.error("No description provided"); throw new InvalidRegistration(); } Date detectionDate = aeNotification.getDetectionDate(); if (detectionDate == null) { logger.error("No detectionDate provided"); throw new InvalidRegistration(); } StudySubjectAssignment assignment = new StudySubjectAssignment(); assignment.setGridId(gridId); AdverseEvent event = new AdverseEvent(); event.setDescription(description); event.setDetectionDate(detectionDate); try { scheduledCalendarService.registerSevereAdverseEvent(assignment, event); } catch (Exception ex) { logger.error("Error registering adverse event: " + ex.getMessage(), ex); throw new RegistrationFailed(); } }
From source file:edu.northwestern.bioinformatics.studycalendar.grid.PSCStudyService.java
public edu.northwestern.bioinformatics.studycalendar.grid.Study retrieveStudyByAssignedIdentifier( String coordinatingCenterIdentifier) throws RemoteException, StudyDoesNotExistsException { //first fetch the study for the coordinating center identifier Study study = studyService.getStudyByAssignedIdentifier(coordinatingCenterIdentifier); if (study == null) { String message = "Exception while exporting study..no study found with given identifier:" + coordinatingCenterIdentifier; logger.debug(message);//from w w w . j a v a2 s. co m StudyDoesNotExistsException studyDoesNotExistsException = new StudyDoesNotExistsException(); studyDoesNotExistsException.setFaultReason(message); studyDoesNotExistsException.setFaultString(message); throw studyDoesNotExistsException; } try { String studyXml = studyXMLWriter.createStudyXML(study); edu.northwestern.bioinformatics.studycalendar.grid.Study gridStudy = populateGridStudy(studyXml); logger.info("exporting study:assigned_identifier" + gridStudy.getAssignedIdentifier()); return gridStudy; } catch (Exception exception) { logger.error( "errror while exporting study.grid id:" + study.getId() + " message:" + exception.getMessage()); throw new RemoteException(exception.getMessage()); } }
From source file:com.vmware.vim25.ws.ApacheHttpClient.java
/** * Invoke a given method with supplied {@link com.vmware.vim25.ws.Argument} on the remote vi server. * This method typically creates the payload needed to send to the vi server. For example you would * pass in RetrieveServiceContent for the methodName, next the params needed for the method. Next give * the returnType the parser should convert the response to in this case the string ServiceContent * <p/>/*from w w w. j a va 2 s .c o m*/ * Returns an {@link Object} of the given return type. Using the example above you would get * a {@link com.vmware.vim25.ServiceContent} Object. * <p/> * * @param methodName Name of the method to execute * @param paras Array of Arguments aka params for the method * @param returnType String name of the return type * @return Object * * @throws java.rmi.RemoteException */ @Override public Object invoke(String methodName, Argument[] paras, String returnType) throws RemoteException { log.trace("Invoking method: " + methodName); String soapMsg = marshall(methodName, paras); InputStream is = null; try { is = post(soapMsg); log.trace("Converting xml response from server to: " + returnType); return unMarshall(returnType, is); } catch (Exception e1) { log.error("Exception caught while invoking method.", e1); throw new RemoteException("VI SDK invoke exception:" + e1); } finally { if (is != null) { try { is.close(); } catch (IOException ignored) { } } } }