@Override public ModuleURN unmarshal(String inValue) throws Exception { return new ModuleURN(inValue); }
return inURN; String providerType = THIS.equals(inURN.providerType()) ? inRequester.providerType() : inURN.providerType(); String providerName = THIS.equals(inURN.providerName()) ? inRequester.providerName() : inURN.providerName(); String instanceName = THIS.equals(inURN.instanceName()) ? inRequester.instanceName() : inURN.instanceName(); if(providerType == null && providerName == null && instanceName == null) { throw new InvalidURNException(new I18NBoundMessage1P( Messages.INCOMPLETE_INSTANCE_URN,inURN.toString())); inURN = new ModuleURN(providerType, providerName, instanceName); return inURN;
@Override public String getDefaultFor(ModuleURN inURN, String inAttribute) throws ModuleException { String propertyValue = null; synchronized (this) { if(ReceiverFactory.INSTANCE_URN.equals(inURN)) { if(mReceiverProperties != null) { propertyValue = mReceiverProperties.get(inAttribute); } } if(ClientModuleFactory.INSTANCE_URN.parent().equals(inURN)) { if(mClientProperties != null) { propertyValue = mClientProperties.get(inAttribute); } } } //fallback on the properties file, in case we fail to add new //client/receiver module properties to the spring configuration. return propertyValue != null ? propertyValue : super.getDefaultFor(inURN, inAttribute); }
boolean noProviderType = inURN.providerType() == null || inURN.providerType().isEmpty(); boolean noProviderName = inURN.providerName() == null || inURN.providerName().isEmpty(); boolean noInstanceName = inURN.instanceName() == null || inURN.instanceName().isEmpty(); for(ModuleURN i: mModules.keySet()) { if((noProviderType || inURN.providerType().equals(i.providerType())) && (noProviderName || inURN.providerName().equals(i.providerName())) && (noInstanceName || inURN.instanceName().equals(i.instanceName()))) { if (returnValue == null) { returnValue = get(i); throw new ModuleNotFoundException(new I18NBoundMessage3P( Messages.MULTIPLE_MODULES_MATCH_URN, inURN.getValue(), returnValue.getURN().getValue(), get(i).getURN().getValue()));
@Override public String getOutputDestination() { if(outputDestination == null) { return null; } return outputDestination.getValue(); } /* (non-Javadoc)
ModuleURN providerURN = module.getURN().parent(); assert providerURN != null; if(!getModuleFactory(providerURN).isMultipleInstances()) { throw new ModuleException(new I18NBoundMessage1P( Messages.CANNOT_DELETE_SINGLETON, inModuleURN.toString())); throw new ModuleStateException(new I18NBoundMessage3P( Messages.DELETE_FAILED_MODULE_STATE_INCORRECT, inModuleURN.toString(), module.getState(), ModuleState.DELETABLE_STATES.toString())); ObjectName objectName = inModuleURN.toObjectName(); try { if(getMBeanServer().isRegistered(objectName)) { throw new BeanRegistrationException(e, new I18NBoundMessage1P(Messages.MODULE_DELETE_ERROR_MXBEAN_UNREG, inModuleURN.getValue()));
inAttribute, inURN); String propertiesFile = new StringBuilder(). append(inURN.providerType()). append("_"). //$NON-NLS-1$ append(inURN.providerName()). append(".properties").toString(); //$NON-NLS-1$ Properties p; if(inURN.instanceURN()) { String value = p.getProperty(inURN.instanceName() + "." + inAttribute); //$NON-NLS-1$ if(value != null) {
String provType = inURN.providerType(); if(provType == null) { throw new InvalidURNException(new I18NBoundMessage1P( inIncompleteURNMessage, inURN.toString())); Messages.INVALID_PROVIDER_TYPE, inURN.toString(),provType)); String provName = inURN.providerName(); if(provName == null) { throw new InvalidURNException(new I18NBoundMessage1P( inIncompleteURNMessage, inURN.toString())); Messages.INVALID_PROVIDER_NAME, inURN.toString(),provName)); if(!inIsPrefix && inURN.instanceURN()) { throw new InvalidURNException(new I18NBoundMessage1P( Messages.PROVIDER_URN_HAS_INSTANCE, inURN.toString()));
/** * 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); } }
getURN().getValue(), type, source, parameters, getURN().instanceName(), this); strategy.start();
if(m == null) { if(inModuleURN.instanceURN()) { ModuleURN parent = inModuleURN.parent(); ModuleFactory factory = findFactoryWithURN(parent); if(factory != null && factory.isAutoInstantiate()) { Messages.MODULE_NOT_FOUND, inModuleURN.toString()));
throw new ModuleStateException(new I18NBoundMessage3P( Messages.MODULE_NOT_STOPPED_STATE_INCORRECT, inModule.getURN().toString(), state, ModuleState.STOPPABLE_STATES.toString())); if(inModule.getURN().equals(SinkModuleFactory.INSTANCE_URN)) { throw new ModuleException(Messages.CANNOT_STOP_SINK_MODULE); throw new DataFlowException(new I18NBoundMessage2P( Messages.CANNOT_STOP_MODULE_DATAFLOWS, inModule.getURN().toString(), participating.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())); } }
"No provider requested, issuing request to all providers"); for(ModuleURN providerUrn : ModuleManager.getInstance().getProviders()) { String providerType = providerUrn.providerType(); String providerName = providerUrn.providerName(); if(providerType.equals("mdata") && !providerName.equals(MarketDataManagerModuleFactory.PROVIDER_NAME)) { for(ModuleURN instanceUrn : ModuleManager.getInstance().getModuleInstances(providerUrn)) {
/** * Returns true if this is a instance URN. * * @return if this is a instance URN. */ public boolean instanceURN() { return instanceName() != null; }
/** * Unregisters the mbean for the factory / instance * with the supplied URN. * * @param urn the module factory / instance URN. * * @throws JMException if there were errors. * @throws ModuleException if there were errors converting module URN * to object name. */ private void unregister(ModuleURN urn) throws JMException, ModuleException { unregister(urn.toObjectName()); }
if(inProviderURN == null || inProviderURN.parentOf(moduleURI)) { urns.add(moduleURI);
/** * Create a new AbstractMarketDataModule instance. * * @param inInstanceURN a <code>ModuleURN</code> value containing the URN of the module * @param inFeed an <code>IMarketDataFeed<T,C></code> value containing the instance of the market data feed that this module wraps */ protected AbstractMarketDataModule(ModuleURN inInstanceURN, MarketDataFeed<T,C> inFeed) { super(inInstanceURN, false); instanceURN = inInstanceURN; feed = inFeed; feedStatus = feed.getFeedStatus(); MBeanNotificationInfo notifyInfo = new MBeanNotificationInfo(new String[] { AttributeChangeNotification.ATTRIBUTE_CHANGE }, AttributeChangeNotification.class.getName(), BEAN_ATTRIBUTE_CHANGED.getText()); mNotificationDelegate = new NotificationBroadcasterSupport(notifyInfo); feed.addFeedComponentListener(new IFeedComponentListener() { @Override public void feedComponentChanged(IFeedComponent inComponent) { setFeedStatus(inComponent.getFeedStatus()); } }); feedsByProviderName.put(inInstanceURN.providerName(), this); } /* (non-Javadoc)
if(m.getState().isStarted() && !SinkModuleFactory.INSTANCE_URN.equals(urn)) { stop(urn);