Examples of ServiceReference


Examples of org.osgi.framework.ServiceReference

    public void run() {
        while (!quit) {
            boolean sleep = true;
            try {
                ServiceReference dev = (ServiceReference) newDevices.keys()
                        .nextElement();
                newDevices.remove(dev);
                sleep = false;
                handleDevice(dev);
            } catch (Exception e) {
View Full Code Here

Examples of org.osgi.framework.ServiceReference

        try {
            ServiceReference[] sra = bc.getServiceReferences(null,
                    DEVICE_FILTER);
            if (sra != null) {
                for (int i = 0; i < sra.length; i++) {
                    ServiceReference dev = sra[i];
                    if (newDevices.put(dev, dev) == null)
                        added = true;
                }
            }
        } catch (Exception e) {
View Full Code Here

Examples of org.osgi.framework.ServiceReference

     *
     * @param level Log level
     * @param msg Log message
     */
    void log(int level, String msg) {
        ServiceReference srLog = bc.getServiceReference(logServiceName);
        if (srLog != null) {
            LogService sLog = (LogService) bc.getService(srLog);
            if (sLog != null) {
                sLog.log(level, msg);
            }
View Full Code Here

Examples of org.osgi.framework.ServiceReference

        }
    }

    static ServiceReference matchCommandGroup(BundleContext bc, String word)
            throws IOException {
        ServiceReference res = null;
        ServiceReference[] refs = null;
        try {
            refs = bc.getServiceReferences(COMMAND_GROUP, "(groupName=" + word
                    + "*)");
        } catch (InvalidSyntaxException ignore) {
View Full Code Here

Examples of org.osgi.framework.ServiceReference

     *            log message
     * @param t
     *            throwable
     */
    void log(int level, String msg, Throwable t) {
        ServiceReference srLog = bc
                .getServiceReference("org.osgi.service.log.LogService");
        if (srLog != null) {
            LogService sLog = (LogService) bc.getService(srLog);
            if (sLog != null) {
                sLog.log(level, msg, t);
View Full Code Here

Examples of org.osgi.framework.ServiceReference

                // Enter
                //
            } else if ("enter".startsWith(args[0])) {
                if (args.length == 2) {
                    try {
                        ServiceReference ref = Command.matchCommandGroup(bc,
                                args[1]);
                        if (ref != null) {
                            si.currentGroup = (String) ref
                                    .getProperty("groupName");
                        } else {
                            si.currentGroup = NAME;
                        }
                        return 0;
View Full Code Here

Examples of org.osgi.framework.ServiceReference

     * @param out
     *            output device to print result
     */
    int helpAbout(String group, PrintWriter out, SessionImpl si) {
        try {
            ServiceReference ref = Command.matchCommandGroup(bc, group);
            if (ref != null) {
                CommandGroup c = (CommandGroup) bc.getService(ref);
                if (c != null) {
                    out.print(c.getLongHelp());
                    bc.ungetService(ref);
View Full Code Here

Examples of org.osgi.framework.ServiceReference


public class CallerActivator implements BundleActivator {
  public void start(BundleContext bc) throws IOException
  {
    ServiceReference sRef =
      bc.getServiceReference(UserService.class.getName());
    if (sRef != null) {
      UserService us = (UserService) bc.getService(sRef);
      if (us != null) {
        us.login("joek");
View Full Code Here

Examples of org.osgi.framework.ServiceReference

    }
  }

  public void stop(BundleContext bc) throws IOException
  {
    ServiceReference sRef =
      bc.getServiceReference(UserService.class.getName());
    if (sRef != null) {
      UserService us = (UserService) bc.getService(sRef);
      if (us != null) {
        us.logout();
View Full Code Here

Examples of org.osgi.framework.ServiceReference

     * @throws Exception DOCUMENT ME!
     */
    private RMICodeBaseService(String mountpoint) throws Exception {
        this.mountpoint = mountpoint;

        ServiceReference ref = Activator.bc.getServiceReference(
                "org.osgi.service.http.HttpService");
        httpService = (HttpService) Activator.bc.getService(ref);

        if (setCodeBase(prepareCodeBase(ref, httpService, mountpoint))) {
            bundleHttpContext = new BundleHttpContext();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.