org.osgi.framework.InvalidSyntaxException Java Examples

The following examples show how to use org.osgi.framework.InvalidSyntaxException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OsgiScriptingEngines.java    From camunda-bpm-platform-osgi with Apache License 2.0 6 votes vote down vote up
@Override
public ScriptEngine getScriptEngineForLanguage(String language) {
   ScriptEngine scriptEngine = null;
   try {
     scriptEngine = resolveScriptEngine(language);
   } catch (InvalidSyntaxException e) {
     throw new ProcessEngineException(
         "problem resolving scripting engine" + e.getMessage(), e);
   }

   if (scriptEngine == null) {
     throw new ProcessEngineException(
         "Can't find scripting engine for '" + language + "'");
   }
   return scriptEngine;
}
 
Example #2
Source File: JQueryOperationsImpl.java    From gvnix with GNU General Public License v3.0 6 votes vote down vote up
public WebMetadataService getWebMetadataService() {
    if (webMetadataService == null) {
        // Get all Services implement WebMetadataService interface
        try {
            ServiceReference<?>[] references = this.context
                    .getAllServiceReferences(
                            WebMetadataService.class.getName(), null);

            for (ServiceReference<?> ref : references) {
                return (WebMetadataService) this.context.getService(ref);
            }

            return null;

        }
        catch (InvalidSyntaxException e) {
            LOGGER.warning("Cannot load WebMetadataService on JQueryOperationsImpl.");
            return null;
        }
    }
    else {
        return webMetadataService;
    }
}
 
Example #3
Source File: MessageBundleUtilsImpl.java    From gvnix with GNU General Public License v3.0 6 votes vote down vote up
public WebProjectUtils getWebProjectUtils() {
    if (webProjectUtils == null) {
        // Get all Services implement WebProjectUtils interface
        try {
            ServiceReference<?>[] references = context
                    .getAllServiceReferences(
                            WebProjectUtils.class.getName(), null);

            for (ServiceReference<?> ref : references) {
                webProjectUtils = (WebProjectUtils) context.getService(ref);
                return webProjectUtils;
            }

            return null;

        }
        catch (InvalidSyntaxException e) {
            LOGGER.warning("Cannot load WebProjectUtils on MessageBundleUtilsImpl.");
            return null;
        }
    }
    else {
        return webProjectUtils;
    }

}
 
Example #4
Source File: DatatablesJspMetadataListener.java    From gvnix with GNU General Public License v3.0 6 votes vote down vote up
public MetadataDependencyRegistry getMetadataDependencyRegistry() {
    if (metadataDependencyRegistry == null) {
        // Get all Services implement MetadataDependencyRegistry interface
        try {
            ServiceReference<?>[] references = this.context
                    .getAllServiceReferences(
                            MetadataDependencyRegistry.class.getName(),
                            null);

            for (ServiceReference<?> ref : references) {
                return (MetadataDependencyRegistry) this.context
                        .getService(ref);
            }

            return null;

        }
        catch (InvalidSyntaxException e) {
            LOGGER.warning("Cannot load MetadataDependencyRegistry on DatatablesJspMetadataListener.");
            return null;
        }
    }
    else {
        return metadataDependencyRegistry;
    }
}
 
Example #5
Source File: NativeRequirement.java    From knopflerfish.org with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
private Filter toFilter(List<String> procs, List<String> oses, List<VersionRange> vers, List<String> langs, String sf)
  throws InvalidSyntaxException
{
  final StringBuffer sb = new StringBuffer(80);
  int elems = 0;
  
  elems = andAdd(sb, orString(NativeNamespace.CAPABILITY_PROCESSOR_ATTRIBUTE, procs));
  elems += andAdd(sb, orString(NativeNamespace.CAPABILITY_OSNAME_ATTRIBUTE, oses));
  elems += andAdd(sb, orString(NativeNamespace.CAPABILITY_OSVERSION_ATTRIBUTE, vers));
  elems += andAdd(sb, orString(NativeNamespace.CAPABILITY_LANGUAGE_ATTRIBUTE, langs));
  elems += andAdd(sb, sf);
  if (elems == 0) {
    return null;
  } else if (elems > 1) {
    sb.insert(0,"(&");
    sb.append(")");
  }
  return FrameworkUtil.createFilter(sb.toString());
}
 
Example #6
Source File: ReportJspMetadataListener.java    From gvnix with GNU General Public License v3.0 6 votes vote down vote up
public PathResolver getPathResolver() {
    if (pathResolver == null) {
        // Get all Services implement PathResolver interface
        try {
            ServiceReference<?>[] references = this.context
                    .getAllServiceReferences(PathResolver.class.getName(),
                            null);

            for (ServiceReference<?> ref : references) {
                return (PathResolver) this.context.getService(ref);
            }

            return null;

        }
        catch (InvalidSyntaxException e) {
            LOGGER.warning("Cannot load PathResolver on ReportJspMetadataListener.");
            return null;
        }
    }
    else {
        return pathResolver;
    }

}
 
Example #7
Source File: JQueryOperationsImpl.java    From gvnix with GNU General Public License v3.0 6 votes vote down vote up
public MvcOperations getMvcOperations() {
    if (mvcOperations == null) {
        // Get all Services implement MvcOperations interface
        try {
            ServiceReference<?>[] references = this.context
                    .getAllServiceReferences(MvcOperations.class.getName(),
                            null);

            for (ServiceReference<?> ref : references) {
                return (MvcOperations) this.context.getService(ref);
            }

            return null;

        }
        catch (InvalidSyntaxException e) {
            LOGGER.warning("Cannot load MvcOperations on JQueryOperationsImpl.");
            return null;
        }
    }
    else {
        return mvcOperations;
    }
}
 
Example #8
Source File: DependencyListenerImpl.java    From gvnix with GNU General Public License v3.0 6 votes vote down vote up
public ProjectOperations getProjectOperations() {
    if (projectOperations == null) {
        // Get all Services implement ProjectOperations interface
        try {
            ServiceReference[] references = context
                    .getAllServiceReferences(
                            ProjectOperations.class.getName(), null);

            for (ServiceReference ref : references) {
                projectOperations = (ProjectOperations) context
                        .getService(ref);
                return projectOperations;
            }

            return null;

        }
        catch (InvalidSyntaxException e) {
            LOGGER.warning("Cannot load ProjectOperations on DependencyListenerImpl.");
            return null;
        }
    }
    else {
        return projectOperations;
    }
}
 
Example #9
Source File: BootstrapOperationsImpl.java    From gvnix with GNU General Public License v3.0 6 votes vote down vote up
public PathResolver getPathResolver() {
    if (pathResolver == null) {
        // Get all Services implement PathResolver interface
        try {
            ServiceReference<?>[] references = this.context
                    .getAllServiceReferences(PathResolver.class.getName(),
                            null);

            for (ServiceReference<?> ref : references) {
                return (PathResolver) this.context.getService(ref);
            }

            return null;

        }
        catch (InvalidSyntaxException e) {
            LOGGER.warning("Cannot load PathResolver on BootstrapOperationsImpl.");
            return null;
        }
    }
    else {
        return pathResolver;
    }
}
 
Example #10
Source File: PullManager.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
public PullManager () throws InvalidSyntaxException
{
    final String driver = DataSourceHelper.getDriver ( SPECIFIC_PREFIX, DataSourceHelper.DEFAULT_PREFIX );
    this.tracker = new DataSourceFactoryTracker ( Activator.getContext (), driver, null );

    if ( driver == null )
    {
        logger.error ( "JDBC driver is not set" );
        throw new IllegalStateException ( "JDBC driver name is not set" );
    }

    this.tracker.open ();

    this.thread = new Thread ( "org.eclipse.scada.ae.slave.pull.Worker" ) {
        @Override
        public void run ()
        {
            PullManager.this.run ();
        }
    };
    this.thread.start ();
}
 
Example #11
Source File: MonitoringOperationsImpl.java    From gvnix with GNU General Public License v3.0 6 votes vote down vote up
public PathResolver getPathResolver() {
    if (pathResolver == null) {
        // Get all Services implement PathResolver interface
        try {
            ServiceReference<?>[] references = this.context
                    .getAllServiceReferences(PathResolver.class.getName(),
                            null);

            for (ServiceReference<?> ref : references) {
                return (PathResolver) this.context.getService(ref);
            }

            return null;

        }
        catch (InvalidSyntaxException e) {
            LOGGER.warning("Cannot load PathResolver on MonitoringOperationsImpl.");
            return null;
        }
    }
    else {
        return pathResolver;
    }

}
 
Example #12
Source File: MonitoringOperationsImpl.java    From gvnix with GNU General Public License v3.0 6 votes vote down vote up
public TypeLocationService getTypeLocationService() {
    if (typeLocationService == null) {
        // Get all Services implement TypeLocationService interface
        try {
            ServiceReference<?>[] references = this.context
                    .getAllServiceReferences(
                            TypeLocationService.class.getName(), null);

            for (ServiceReference<?> ref : references) {
                return (TypeLocationService) this.context.getService(ref);
            }

            return null;

        }
        catch (InvalidSyntaxException e) {
            LOGGER.warning("Cannot load TypeLocationService on MonitoringOperationsImpl.");
            return null;
        }
    }
    else {
        return typeLocationService;
    }

}
 
Example #13
Source File: WSImportMetadataProvider.java    From gvnix with GNU General Public License v3.0 6 votes vote down vote up
public ProjectOperations getProjectOperations() {
    if (projectOperations == null) {
        // Get all Services implement ProjectOperations interface
        try {
            ServiceReference<?>[] references = this.context
                    .getAllServiceReferences(
                            ProjectOperations.class.getName(), null);

            for (ServiceReference<?> ref : references) {
                return (ProjectOperations) this.context.getService(ref);
            }

            return null;

        }
        catch (InvalidSyntaxException e) {
            LOGGER.warning("Cannot load ProjectOperations on WSImportMetadataProvider.");
            return null;
        }
    }
    else {
        return projectOperations;
    }
}
 
Example #14
Source File: DependencyListenerImpl.java    From gvnix with GNU General Public License v3.0 6 votes vote down vote up
public GeoOperations getGeoOperations() {
    if (operations == null) {
        // Get all Services implement GeoOperations interface
        try {
            ServiceReference[] references = context
                    .getAllServiceReferences(GeoOperations.class.getName(),
                            null);

            for (ServiceReference ref : references) {
                operations = (GeoOperations) context.getService(ref);
                return operations;
            }

            return null;

        }
        catch (InvalidSyntaxException e) {
            LOGGER.warning("Cannot load GeoOperations on DependencyListenerImpl.");
            return null;
        }
    }
    else {
        return operations;
    }
}
 
Example #15
Source File: BundleLocationCondition.java    From knopflerfish.org with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * Constructs a condition that tries to match the passed Bundle's location
 * to the location pattern.
 * 
 * @param bundle The Bundle being evaluated.
 * @param info The ConditionInfo from which to construct the condition. The
 *        ConditionInfo must specify one or two arguments. The first
 *        argument of the ConditionInfo specifies the location pattern
 *        against which to match the bundle location. Matching is done
 *        according to the filter string matching rules. Any '*' characters
 *        in the first argument are used as wildcards when matching bundle
 *        locations unless they are escaped with a '\' character. The
 *        Condition is satisfied if the bundle location matches the pattern.
 *        The second argument of the ConditionInfo is optional. If a second
 *        argument is present and equal to "!", then the satisfaction of the
 *        Condition is negated. That is, the Condition is satisfied if the
 *        bundle location does NOT match the pattern. If the second argument
 *        is present but does not equal "!", then the second argument is
 *        ignored.
 * @return Condition object for the requested condition.
 */
static public Condition getCondition(final Bundle bundle, final ConditionInfo info) {
	if (!CONDITION_TYPE.equals(info.getType()))
		throw new IllegalArgumentException("ConditionInfo must be of type \"" + CONDITION_TYPE + "\"");
	String[] args = info.getArgs();
	if (args.length != 1 && args.length != 2)
		throw new IllegalArgumentException("Illegal number of args: " + args.length);
	String bundleLocation = AccessController.doPrivileged(new PrivilegedAction<String>() {
		public String run() {
			return bundle.getLocation();
		}
	});
	Filter filter = null;
	try {
		filter = FrameworkUtil.createFilter("(location=" + escapeLocation(args[0]) + ")");
	} catch (InvalidSyntaxException e) {
		// this should never happen, but just in case
		throw new RuntimeException("Invalid filter: " + e.getFilter(), e);
	}
	Dictionary<String, String> matchProps = new Hashtable<String, String>(2);
	matchProps.put("location", bundleLocation);
	boolean negate = (args.length == 2) ? "!".equals(args[1]) : false;
	return (negate ^ filter.match(matchProps)) ? Condition.TRUE : Condition.FALSE;
}
 
Example #16
Source File: JpaGeoOperationsImpl.java    From gvnix with GNU General Public License v3.0 6 votes vote down vote up
public FileManager getFileManager() {
    if (fileManager == null) {
        // Get all Services implement FileManager interface
        try {
            ServiceReference<?>[] references = this.context
                    .getAllServiceReferences(FileManager.class.getName(),
                            null);

            for (ServiceReference<?> ref : references) {
                return (FileManager) this.context.getService(ref);
            }

            return null;

        }
        catch (InvalidSyntaxException e) {
            LOGGER.warning("Cannot load FileManager on JpaGeoOperationsImpl.");
            return null;
        }
    }
    else {
        return fileManager;
    }

}
 
Example #17
Source File: LDAPQuery.java    From knopflerfish.org with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
void doQuery() throws InvalidSyntaxException {
    if (tail.length() < 3 || !prefix("("))
        error(MALFORMED);

    switch (tail.charAt(0)) {
    case '&':
        doAnd();
        break;
    case '|':
        doOr();
        break;
    case '!':
        doNot();
        break;
    default:
        doSimple();
        break;
    }

    if (!prefix(")"))
        error(MALFORMED);
}
 
Example #18
Source File: DatatablesOperationsImpl.java    From gvnix with GNU General Public License v3.0 6 votes vote down vote up
public I18nSupport getI18nSupport() {
    if (i18nSupport == null) {
        // Get all Services implement I18nSupport interface
        try {
            ServiceReference<?>[] references = this.context
                    .getAllServiceReferences(I18nSupport.class.getName(),
                            null);

            for (ServiceReference<?> ref : references) {
                return (I18nSupport) this.context.getService(ref);
            }

            return null;

        }
        catch (InvalidSyntaxException e) {
            LOGGER.warning("Cannot load I18nSupport on DatatablesOperationsImpl.");
            return null;
        }
    }
    else {
        return i18nSupport;
    }
}
 
Example #19
Source File: ReportMetadataProvider.java    From gvnix with GNU General Public License v3.0 6 votes vote down vote up
public WebMetadataService getWebMetadataService() {
    if (webMetadataService == null) {
        // Get all Services implement WebMetadataService interface
        try {
            ServiceReference<?>[] references = this.context
                    .getAllServiceReferences(
                            WebMetadataService.class.getName(), null);

            for (ServiceReference<?> ref : references) {
                return (WebMetadataService) this.context.getService(ref);
            }

            return null;

        }
        catch (InvalidSyntaxException e) {
            logger.warning("Cannot load WebMetadataService on ReportMetadataProvider.");
            return null;
        }
    }
    else {
        return webMetadataService;
    }

}
 
Example #20
Source File: WSExportMetadataProvider.java    From gvnix with GNU General Public License v3.0 6 votes vote down vote up
public WSConfigService getWSConfigService() {
    if (wSConfigService == null) {
        // Get all Services implement WSConfigService interface
        try {
            ServiceReference<?>[] references = this.context
                    .getAllServiceReferences(
                            WSConfigService.class.getName(), null);

            for (ServiceReference<?> ref : references) {
                return (WSConfigService) this.context.getService(ref);
            }

            return null;

        }
        catch (InvalidSyntaxException e) {
            LOGGER.warning("Cannot load WSConfigService on WSExportMetadataProvider.");
            return null;
        }
    }
    else {
        return wSConfigService;
    }
}
 
Example #21
Source File: MovingAverageDataSource.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
private void updateDataSource () throws InvalidSyntaxException
{
    logger.debug ( "updateDataSource ()" );
    if ( this.dataSourceTracker != null )
    {
        this.dataSourceTracker.close ();
        this.dataSourceTracker = null;
    }
    if ( this.dataSourceId != null )
    {
        logger.debug ( "track datasource {}", this.dataSourceId );
        this.dataSourceTracker = new SingleDataSourceTracker ( this.poolTracker, this.dataSourceId, new ServiceListener () {
            @Override
            public void dataSourceChanged ( final DataSource dataSource )
            {
                setDataSource ( dataSource );
            }
        } );
        this.dataSourceTracker.open ();
    }
}
 
Example #22
Source File: ConnectionTracker.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
protected Filter createFilter ()
{
    try
    {
        Class<?> filterClazz;
        if ( this.clazz != null )
        {
            filterClazz = this.clazz;
        }
        else
        {
            filterClazz = ConnectionService.class;
        }

        return FilterUtil.createAndFilter ( filterClazz.getName (), createFilterParameters () );
    }
    catch ( final InvalidSyntaxException e )
    {
        logger.warn ( "Failed to create filter", e );
        return null;
    }
}
 
Example #23
Source File: BundleContextImpl.java    From AtlasForAndroid with MIT License 6 votes vote down vote up
public ServiceReference[] getServiceReferences(String str, String str2) throws InvalidSyntaxException {
    Collection collection;
    checkValid();
    Filter fromString = RFC1960Filter.fromString(str2);
    if (str == null) {
        collection = Framework.services;
    } else {
        List list = (List) Framework.classes_services.get(str);
        if (list == null) {
            return null;
        }
    }
    List arrayList = new ArrayList();
    ServiceReferenceImpl[] serviceReferenceImplArr = (ServiceReferenceImpl[]) collection.toArray(new ServiceReferenceImpl[collection.size()]);
    for (int i = 0; i < serviceReferenceImplArr.length; i++) {
        if (fromString.match(serviceReferenceImplArr[i])) {
            arrayList.add(serviceReferenceImplArr[i]);
        }
    }
    if (Framework.DEBUG_SERVICES && log.isInfoEnabled()) {
        log.info("Framework: REQUESTED SERVICES " + str + " " + str2);
        log.info("\tRETURNED " + arrayList);
    }
    return arrayList.size() == 0 ? null : (ServiceReference[]) arrayList.toArray(new ServiceReference[arrayList.size()]);
}
 
Example #24
Source File: DatatablesOperationsImpl.java    From gvnix with GNU General Public License v3.0 6 votes vote down vote up
public WebMvcOperations getWebMvcOperations() {
    if (webMvcOperations == null) {
        // Get all Services implement WebMvcOperations interface
        try {
            ServiceReference<?>[] references = this.context
                    .getAllServiceReferences(
                            WebMvcOperations.class.getName(), null);

            for (ServiceReference<?> ref : references) {
                return (WebMvcOperations) this.context.getService(ref);
            }

            return null;

        }
        catch (InvalidSyntaxException e) {
            LOGGER.warning("Cannot load WebMvcOperations on DatatablesOperationsImpl.");
            return null;
        }
    }
    else {
        return webMvcOperations;
    }
}
 
Example #25
Source File: MenuEntryOperationsImpl.java    From gvnix with GNU General Public License v3.0 6 votes vote down vote up
public WebProjectUtils getWebProjectUtils() {
    if (webProjectUtils == null) {
        // Get all Services implement WebProjectUtils interface
        try {
            ServiceReference<?>[] references = this.context
                    .getAllServiceReferences(
                            WebProjectUtils.class.getName(), null);

            for (ServiceReference<?> ref : references) {
                webProjectUtils = (WebProjectUtils) this.context
                        .getService(ref);
                return webProjectUtils;
            }

            return null;

        }
        catch (InvalidSyntaxException e) {
            LOGGER.warning("Cannot load WebProjectUtils on MenuEntryOperationsImpl.");
            return null;
        }
    }
    else {
        return webProjectUtils;
    }
}
 
Example #26
Source File: BootstrapOperationsImpl.java    From gvnix with GNU General Public License v3.0 6 votes vote down vote up
public FileManager getFileManager() {
    if (fileManager == null) {
        // Get all Services implement FileManager interface
        try {
            ServiceReference<?>[] references = this.context
                    .getAllServiceReferences(FileManager.class.getName(),
                            null);

            for (ServiceReference<?> ref : references) {
                return (FileManager) this.context.getService(ref);
            }

            return null;

        }
        catch (InvalidSyntaxException e) {
            LOGGER.warning("Cannot load FileManager on BootstrapOperationsImpl.");
            return null;
        }
    }
    else {
        return fileManager;
    }
}
 
Example #27
Source File: WSImportMetadataProvider.java    From gvnix with GNU General Public License v3.0 6 votes vote down vote up
public SecurityService getSecurityService() {
    if (securityService == null) {
        // Get all Services implement SecurityService interface
        try {
            ServiceReference<?>[] references = this.context
                    .getAllServiceReferences(
                            SecurityService.class.getName(), null);

            for (ServiceReference<?> ref : references) {
                return (SecurityService) this.context.getService(ref);
            }

            return null;

        }
        catch (InvalidSyntaxException e) {
            LOGGER.warning("Cannot load SecurityService on WSImportMetadataProvider.");
            return null;
        }
    }
    else {
        return securityService;
    }
}
 
Example #28
Source File: BundleLocationCondition.java    From concierge with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Constructs a condition that tries to match the passed Bundle's location
 * to the location pattern.
 * 
 * @param bundle The Bundle being evaluated.
 * @param info The ConditionInfo from which to construct the condition. The
 *        ConditionInfo must specify one or two arguments. The first
 *        argument of the ConditionInfo specifies the location pattern
 *        against which to match the bundle location. Matching is done
 *        according to the filter string matching rules. Any '*' characters
 *        in the first argument are used as wildcards when matching bundle
 *        locations unless they are escaped with a '\' character. The
 *        Condition is satisfied if the bundle location matches the pattern.
 *        The second argument of the ConditionInfo is optional. If a second
 *        argument is present and equal to "!", then the satisfaction of the
 *        Condition is negated. That is, the Condition is satisfied if the
 *        bundle location does NOT match the pattern. If the second argument
 *        is present but does not equal "!", then the second argument is
 *        ignored.
 * @return Condition object for the requested condition.
 */
static public Condition getCondition(final Bundle bundle, final ConditionInfo info) {
	if (!CONDITION_TYPE.equals(info.getType()))
		throw new IllegalArgumentException("ConditionInfo must be of type \"" + CONDITION_TYPE + "\"");
	String[] args = info.getArgs();
	if (args.length != 1 && args.length != 2)
		throw new IllegalArgumentException("Illegal number of args: " + args.length);
	String bundleLocation = AccessController.doPrivileged(new PrivilegedAction<String>() {
		public String run() {
			return bundle.getLocation();
		}
	});
	Filter filter = null;
	try {
		filter = FrameworkUtil.createFilter("(location=" + escapeLocation(args[0]) + ")");
	} catch (InvalidSyntaxException e) {
		// this should never happen, but just in case
		throw new RuntimeException("Invalid filter: " + e.getFilter(), e);
	}
	Dictionary<String, String> matchProps = new Hashtable<String, String>(2);
	matchProps.put("location", bundleLocation);
	boolean negate = (args.length == 2) ? "!".equals(args[1]) : false;
	return (negate ^ filter.match(matchProps)) ? Condition.TRUE : Condition.FALSE;
}
 
Example #29
Source File: HistoricalItemImpl.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
public void update ( final Map<String, String> properties ) throws InvalidSyntaxException
{
    final String dataSourceId = properties.get ( DataSource.DATA_SOURCE_ID );

    synchronized ( this )
    {
        logger.info ( "Updating..." );

        try
        {
            this.maxBufferSize = Integer.parseInt ( properties.get ( "maxBufferSize" ) );
        }
        catch ( final NumberFormatException e )
        {
            this.maxBufferSize = DEFAULT_MAX_BUFFER_SIZE;
        }
        this.dataSourceId = dataSourceId;
        updateDataSource ();

        logger.info ( "Updating... done" );
    }
}
 
Example #30
Source File: HistoricalItemImpl.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
private void updateDataSource () throws InvalidSyntaxException
{
    logger.debug ( "updateDataSource ()" );
    if ( this.dataSourceTracker != null )
    {
        this.dataSourceTracker.close ();
        this.dataSourceTracker = null;
    }
    if ( this.dataSourceId != null )
    {
        logger.debug ( "track datasource " + this.dataSourceId );
        this.dataSourceTracker = new SingleDataSourceTracker ( this.poolTracker, this.dataSourceId, new ServiceListener () {
            @Override
            public void dataSourceChanged ( final DataSource dataSource )
            {
                setDataSource ( dataSource );
            }
        } );
        this.dataSourceTracker.open ();
    }
}