throw new MXBeanOperationException(e, new I18NBoundMessage1P( Messages.BEAN_OBJECT_NAME_ERROR,toString()));
/** * Validates that the module instance with the specified URN is * from the provider with the specified provider URN. * * @param inInstanceURN the instance URN * @param inProviderURN the provider URN * * @throws InvalidURNException if the module instance is not * from the specified provider URN */ private static void validateInstanceOf(ModuleURN inInstanceURN, ModuleURN inProviderURN) throws InvalidURNException { if(!inProviderURN.parentOf(inInstanceURN)) { throw new InvalidURNException(new I18NBoundMessage2P( Messages.INSTANCE_PROVIDER_URN_MISMATCH, inInstanceURN.toString(), inProviderURN.toString())); } }
/** * Verifies the URN scheme. * * @param inURN the URN to verify * * @throws InvalidURNException if the URN has an invalid scheme. */ private static void verifyScheme(ModuleURN inURN) throws InvalidURNException { if(!ModuleURN.SCHEME.equals(inURN.scheme())) { throw new InvalidURNException(new I18NBoundMessage3P( Messages.INVALID_URN_SCHEME, inURN.scheme(), inURN.toString(), ModuleURN.SCHEME)); } }
/** * Retrieves the module factory for the supplied URN. * * @param inUrn the provider URN. The URN should be validated. This method * doesn't validate the URN and its behavior is unspecified if the supplied * URN is not validated. * * @return the module factory instance. * * @throws ProviderNotFoundException if the module factory was not found. */ private ModuleFactory getModuleFactory(ModuleURN inUrn) throws ProviderNotFoundException { ModuleFactory factory; factory = findFactoryWithURN(inUrn); if(factory == null) { throw new ProviderNotFoundException(new I18NBoundMessage1P( Messages.PROVIDER_NOT_FOUND, inUrn.toString())); } return factory; }
if(!urns.isEmpty()) { throw new ModuleCreationException(new I18NBoundMessage2P( Messages.CANNOT_CREATE_SINGLETON, inProviderURN.toString(), urns.get(0).toString())); inProviderURN.toString(), paramTypes.length, inParameters == null ? 0 throw new ModuleCreationException(new I18NBoundMessage4P( Messages.CANNOT_CREATE_MODULE_WRONG_PARAM_TYPE, inProviderURN.toString(), i,c.getName(), inParameters[i].getClass().getName()));
/** * Finds the module, given its instance URN. * * @param inModuleURN the module instance URN. The URN should already * be validated, this method does not validate the supplied URN. * * @return the module instance * * @throws InvalidURNException if the module URN is invalid * @throws ModuleNotFoundException if the module was not found */ private Module getModule(ModuleURN inModuleURN) throws InvalidURNException, ModuleNotFoundException { URNUtils.validateInstanceURN(inModuleURN); Module module = mModules.get(inModuleURN); if(module == null) { throw new ModuleNotFoundException(new I18NBoundMessage1P( Messages.MODULE_NOT_FOUND, inModuleURN.toString())); } return module; }
/** * Sends an attribute change notification for change in the * {@link #isConnected()} value. * * @param inOldValue the old attribute value. * @param inNewValue the new attribute value. */ @Override public void connectionStatusChanged(boolean inOldValue, boolean inNewValue) { if (getState().isStarted() || getState() == ModuleState.STARTING || getState() == ModuleState.STOPPING) { SLF4JLoggerProxy.debug(this, "Sending attrib changed from {} to {}", //$NON-NLS-1$ inOldValue, inNewValue); mNotifySupport.sendNotification(new AttributeChangeNotification( getURN().toString(), mSequence.getAndIncrement(), System.currentTimeMillis(), Messages.ATTRIB_CHANGE_NOTIFICATION.getText(), "Connected", //$NON-NLS-1$ "boolean", //$NON-NLS-1$ inOldValue, inNewValue)); } }
/** * Validates the module instance URN. * * @param inURN the module instance URN. * @param inProviderURN the module provider URN. If not null, * the module URN is verified to have this URN as its prefix. * * @throws InvalidURNException if the module URN is invalid. */ public static void validateInstanceURN(ModuleURN inURN, ModuleURN inProviderURN) throws InvalidURNException { validateProviderURN(inURN, Messages.INCOMPLETE_INSTANCE_URN, true); if(!inURN.instanceURN()) { throw new InvalidURNException(new I18NBoundMessage1P( Messages.INCOMPLETE_INSTANCE_URN, inURN.toString())); } String instanceName = inURN.instanceName(); if(!isValidIdentifier(instanceName)) { throw new InvalidURNException(new I18NBoundMessage2P( Messages.INVALID_INSTANCE_URN, inURN.toString(), instanceName)); } if (inProviderURN != null) { validateInstanceOf(inURN, inProviderURN); } }
if(provType == null) { throw new InvalidURNException(new I18NBoundMessage1P( inIncompleteURNMessage, inURN.toString())); Messages.INVALID_PROVIDER_TYPE, inURN.toString(),provType)); if(provName == null) { throw new InvalidURNException(new I18NBoundMessage1P( inIncompleteURNMessage, inURN.toString())); Messages.INVALID_PROVIDER_NAME, inURN.toString(),provName)); Messages.PROVIDER_URN_HAS_INSTANCE, inURN.toString()));
instanceName == null) { throw new InvalidURNException(new I18NBoundMessage1P( Messages.INCOMPLETE_INSTANCE_URN,inURN.toString()));
new I18NBoundMessage2P( Messages.CANNOT_CREATE_MODULE_PARAM_CONVERT_ERROR, providerURN.toString(),i));
throw new ModuleException(new I18NBoundMessage1P( Messages.INCORRECT_FACTORY_AUTO_INSTANTIATE, urn.toString()));
throw new ModuleStateException(new I18NBoundMessage3P( Messages.MODULE_NOT_STOPPED_STATE_INCORRECT, inModule.getURN().toString(), state, ModuleState.STOPPABLE_STATES.toString())); throw new DataFlowException(new I18NBoundMessage2P( Messages.CANNOT_STOP_MODULE_DATAFLOWS, inModule.getURN().toString(), participating.toString()));
throw new ModuleStateException(new I18NBoundMessage3P( Messages.DATAFLOW_FAILED_REQ_MODULE_STATE_INCORRECT, inRequester.getURN().toString(), state, ModuleState.REQUEST_FLOW_STATES.toString())); throw new DataFlowException(new I18NBoundMessage1P( Messages.MODULE_NOT_EMITTER, module.getURN().toString())); throw new DataFlowException(new I18NBoundMessage1P( Messages.MODULE_NOT_RECEIVER, module.getURN().toString())); throw new ModuleStateException(new I18NBoundMessage3P( Messages.DATAFLOW_FAILED_PCPT_MODULE_STATE_INCORRECT, module.getURN().toString(), module.getState(), ModuleState.PARTICIPATE_FLOW_STATES.toString()));
Messages.CANCEL_FAILED_MODULE_STATE_INCORRECT, inFlowID.getValue(), inRequester.getURN().toString(), state, ModuleState.CANCEL_FLOW_STATES.toString()));
Messages.MODULE_NOT_FOUND, inModuleURN.toString()));
throw new ModuleStateException(new I18NBoundMessage3P( Messages.MODULE_NOT_STARTED_STATE_INCORRECT, inModule.getURN().toString(), state, ModuleState.STARTABLE_STATES.toString()));