Package org.osgi.framework

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


     * @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


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

    }
  }

  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

     * @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

    public StringBuffer  bundleInfo(Bundle[] targets) {
      StringBuffer sb = new StringBuffer();

      startFont(sb);
      ServiceReference sr = Activator
        .getTargetBC_getServiceReference(PackageAdmin.class.getName());
      PackageAdmin pkgAdmin
        = (PackageAdmin) Activator.getTargetBC_getService(sr);
      if(pkgAdmin == null) {
        sb.append("No PackageAdmin service found");
View Full Code Here

    log("starting");
   
    String filter = "(objectclass=" + DateService.class.getName() + ")";
    bc.addServiceListener(listener, filter);
   
    ServiceReference references[] = bc.getServiceReferences(null, filter);
    for (int i = 0; references != null && i < references.length; i++)
      {
        listener.serviceChanged(new ServiceEvent(ServiceEvent.REGISTERED,
                                                 references[i]));
      }
View Full Code Here

  public static void log(int level, String msg) {
    log(level, msg, null);
  }

  public static void log(int level, String msg, Exception e) {
    ServiceReference srLog = bc.getServiceReference(logServiceName);
    if (srLog != null) {
      LogService sLog = (LogService)bc.getService(srLog);
      if (sLog != null) {
        if(e != null) {
          sLog.log(level, msg, e);
View Full Code Here

    detailPanel.setBorder(null);

    detailPanel.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
          for(Iterator it = detailMap.keySet().iterator(); it.hasNext();) {
            ServiceReference sr = (ServiceReference)it.next();
            Object obj = detailMap.get(sr);

            if(obj instanceof DefaultSwingBundleDisplayer) {

              ((DefaultSwingBundleDisplayer)obj).setTabSelected();
View Full Code Here

    viewPopupMenu = new JPopupMenu();
    menuMap.clear();

    for(Iterator it = displayMap.keySet().iterator(); it.hasNext(); ) {
      final ServiceReference     sr   = (ServiceReference)it.next();
      final String key = (String)sr.getProperty(SwingBundleDisplayer.PROP_NAME);

      JMenuItem item = new JMenuItem(key);
      item.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent ev) {
            bundlePanelShowTab(sr);
View Full Code Here

TOP

Related Classes of org.osgi.framework.ServiceReference

Copyright © 2018 www.massapicom. 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.