/** * Fails if invoked from within * {@link DataEmitter#requestData(DataRequest, DataEmitterSupport)} or * {@link DataEmitter#cancel(DataFlowID, RequestID)}. * * @throws ModuleException if its an incorrect nested flow request. */ private static void verifyIncorrectInvocation() throws ModuleException { if(AbstractDataCoupler.isNestedFlowCall()) { throw new ModuleException(Messages.INCORRECT_NESTED_FLOW_REQUEST); } } private final Module mRequester;
@Override protected void preStart() throws ModuleException { //Check if the broker URL is supplied String url = getURL(); if(url == null) { throw new ModuleException(Messages.START_FAIL_NO_URL); } try { mDataEmitter = new RemoteDataEmitter(url, getUsername(), mPassword, this); } catch(Exception e) { throw new ModuleException(e, Messages.ERROR_STARTING_MODULE); } }
/** * Sets the refresh listener that intercepts the {@link #refresh()} * invocations. Only one refresh listener can be setup. If a * refresh listener is already setup when this method is invoked, * an exception is thrown. * * @param inRefreshListener the refresh listener instance * * @throws ModuleException if a refresh listener is already setup. */ public void setRefreshListener(RefreshListener inRefreshListener) throws ModuleException { synchronized (mOperationsLock) { if (mRefreshListener == null) { mRefreshListener = inRefreshListener; } else { throw new ModuleException(new I18NBoundMessage1P( Messages.REFRESH_LISTENER_ALREADY_SETUP, mRefreshListener.getClass().getName())); } } }
/** * Generates the request ID. * * @return the request ID. * * @throws ModuleException if there were errors generating the request ID. */ private static RequestID generateRequestID() throws ModuleException { try { return new RequestID(sIDFactory.getNext()); } catch (NoMoreIDsException e) { throw new ModuleException(e, Messages.UNABLE_GENERATE_REQUEST_ID); } }
/** * Generates a unique ID for a data flow. * * @return a unique ID for identifying a data flow * * @throws ModuleException if there were errors generating the * data flow ID. */ private static DataFlowID generateFlowID() throws ModuleException { try { return new DataFlowID(sIDFactory.getNext()); } catch (NoMoreIDsException e) { throw new ModuleException(e, Messages.UNABLE_GENERATE_FLOW_ID); } }
Messages.LOG_ERROR_READ_DEFAULT_CONFIG.warn(this, e, propertiesFile, inURN, inAttribute); throw new ModuleException(e, new I18NBoundMessage1P( Messages.ERROR_READ_PROPERTIES,propertiesFile));
throw new ModuleException(e, Messages.MODULE_CONFIGURATION_ERROR); } catch (IOException e) { throw new ModuleException(e, Messages.ERROR_REFRESH);
@Override protected void preStart() throws ModuleException { SLF4JLoggerProxy.debug(this, "starting {}", //$NON-NLS-1$ this); feed.start(); try { feed.login(getCredentials()); } catch (Exception e) { throw new ModuleException(e); } CapabilityCollection.reportCapability(feed.getCapabilities()); } /* (non-Javadoc)
inModule.getURN()); if(inModule.getClass().isAnnotationPresent(AutowiredModule.class)) { throw new ModuleException(new I18NBoundMessage1P(Messages.MODULE_REQUIRES_AUTOWIRING, inModule.getURN())); e, inModule.getURN()); throw new ModuleException(e, new I18NBoundMessage1P(Messages.CANNOT_AUTOWIRE_MODULE, inModule.getURN()));
if(list == null || list.length != 1 || (!ModuleURN.class.equals(list[0]))) { throw new ModuleException(new I18NBoundMessage1P( Messages.INCORRECT_FACTORY_AUTO_INSTANTIATE, urn.toString()));
throw new ModuleException(Messages.CANNOT_STOP_SINK_MODULE);
assert providerURN != null; if(!getModuleFactory(providerURN).isMultipleInstances()) { throw new ModuleException(new I18NBoundMessage1P( Messages.CANNOT_DELETE_SINGLETON, inModuleURN.toString()));
failed = false; } catch (ServiceConfigurationError e) { throw new ModuleException(e, Messages.MODULE_CONFIGURATION_ERROR); } catch (JMException e) { throw new BeanRegistrationException(e,new I18NBoundMessage1P(
throw new ModuleException(Messages.FEED_CONFIG_REQUIRED); SLF4JLoggerProxy.warn(this, e); throw new ModuleException(e);
strategy.start(); } catch (Exception e) { throw new ModuleException(e, FAILED_TO_START);
throw e; } catch (JMException e) { throw new ModuleException(e, Messages.BEAN_UNREGISTRATION_ERROR);