All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javolution.osgi.internal.ProgramTrackerImpl Maven / Gradle / Ivy

Go to download

Only the Java Core part of Javolution library, with slight modifications for use in MSFTBX.

There is a newer version: 6.11.8
Show newest version
/*
 * Javolution - Java(TM) Solution for Real-Time and Embedded Systems
 * Copyright (C) 2012 - Javolution (http://javolution.org/)
 * All rights reserved.
 * 
 * Permission to use, copy, modify, and distribute this software is
 * freely granted, provided that this notice is preserved.
 */
package javolution.osgi.internal;

import javolution.context.ComputeContext;
import javolution.context.ComputeContext.Program;

import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.util.tracker.ServiceTracker;

/**
 * Service to load/unload OpenCL programs.
 */
public final class ProgramTrackerImpl extends ServiceTracker {

	public ProgramTrackerImpl(BundleContext bc) {
		super(bc, Program.class, null);
	}

	public Program addingService(ServiceReference reference) {
		Program program = super.addingService(reference);
		ComputeContext.load(program);
		return program;
	}

	public void removedService(ServiceReference reference,
			Program program) {
		super.removedService(reference, program);
		ComputeContext.unload(program);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy