Package net.jini.lookup.entry

Examples of net.jini.lookup.entry.ServiceType


     * 'Equality' checks for attributes which may be preferred, but visible
     * to the test classpath
     */
    private static boolean specialCheck(Entry a1, Entry a2) {
  if (a1 instanceof ServiceType && a2 instanceof ServiceType) {
      ServiceType t1 = (ServiceType) a1;
      ServiceType t2 = (ServiceType) a2;
      if (t1.getDisplayName() != null) {
    if (!t1.getDisplayName().equals(t2.getDisplayName())) {
        return false;
    }
      } else if (t2.getDisplayName() != null) {
        return false;
      }
      if (t1.getShortDescription() != null) {
    if (!t1.getShortDescription().equals(t2.getShortDescription())) {
        return false;
    }
      } else if (t2.getShortDescription() != null) {
        return false;
      }
      return true;
  }
  return false;
View Full Code Here


     * 'Equality' checks for attributes which may be preferred, but visible
     * to the test classpath
     */
    private static boolean specialCheck(Entry a1, Entry a2) {
  if (a1 instanceof ServiceType && a2 instanceof ServiceType) {
      ServiceType t1 = (ServiceType) a1;
      ServiceType t2 = (ServiceType) a2;
      if (t1.getDisplayName() != null) {
    if (!t1.getDisplayName().equals(t2.getDisplayName())) {
        return false;
    }
      } else if (t2.getDisplayName() != null) {
        return false;
      }
      if (t1.getShortDescription() != null) {
    if (!t1.getShortDescription().equals(t2.getShortDescription())) {
        return false;
    }
      } else if (t2.getShortDescription() != null) {
        return false;
      }
      return true;
  }
  return false;
View Full Code Here

    }

    public void killService() {
        try {
            String name;
            ServiceType sType = getServiceType(this.attrs);
            if (sType != null)
                name = sType.getDisplayName();
            else
                name = this.item.service.getClass().getName();
            String message = "Terminate the [" + name + "] service?";
            String title = "Terminate Service Confirmation";
            int answer = JOptionPane.showConfirmDialog(
View Full Code Here

        base = new JPanel();
        base.setLayout(new BorderLayout(8, 8));
        tabpane = new JTabbedPane();

        String svcName;
        ServiceType type = getServiceType(attrs);
        if(type!=null) {
            svcName = type.getDisplayName();
        } else {
            svcName = item.service.getClass().getName();
        }

        ComputeResourceInfo computeResourceInfo = getComputeResourceInfo(attrs);

        java.util.Timer taskTimer = new java.util.Timer(true);
        long now = System.currentTimeMillis();
        UIComponentFetcher uiFetcher = new UIComponentFetcher();
        WaitingToLoadTask waitingToLoadTask;
        if(computeResourceInfo!=null)
            waitingToLoadTask = new WaitingToLoadTask(svcName,
                                                      computeResourceInfo.hostName,
                                                      computeResourceInfo.hostAddress);
        else
            waitingToLoadTask = new WaitingToLoadTask(svcName,
                                                      "unknown",
                                                      "unknown");
        TimeoutTask timeoutTask = new TimeoutTask(uiFetcher);
        taskTimer.schedule(waitingToLoadTask,
                           new Date(now+Math.min(1000*5, startupDelay)));
        taskTimer.schedule(timeoutTask, new Date(now+startupDelay));
        uiFetcher.start();
        try {
            uiFetcher.join(startupDelay);
        } catch(InterruptedException e) {
            throw new Exception("Unable to obtain Service UI attributes for "+
                                svcName+" in allotted time of "+
                                (startupDelay/1000)+" seconds");
        }
        waitingToLoadTask.cancel();
        if(waitingToLoadTask.dialog!=null)
            waitingToLoadTask.dialog.dispose();
        if(uiFetcher.isInterrupted())
            throw new Exception("Unable to obtain Service UI attributes for "+
                                svcName+" in allotted time of "+
                                (startupDelay/1000)+" seconds");
        timeoutTask.cancel();
        if(uiFetcher.exception!=null)
            throw uiFetcher.exception;

        ServiceInfo info = getServiceInfo(attrs);
        if(type!=null || info!=null) {
            JPanel svcTypePanel = new JPanel();
            svcTypePanel.setLayout(new BoxLayout(svcTypePanel, BoxLayout.Y_AXIS));

            ServiceTypePanel typePanel = new ServiceTypePanel();
            typePanel.setMaximumSize(new Dimension(Integer.MAX_VALUE, 200));

            if(type!=null) {
                image = type.getIcon(0);
                typePanel.setServiceType(type);
            }

            svcTypePanel.add(Box.createVerticalStrut(8));
            svcTypePanel.add(typePanel);
View Full Code Here

    }

    public AdminFrame(ServiceItem item, long startupDelay, Component component) throws Exception {
        super();
        serviceUIPanel = new ServiceUIPanel(item, startupDelay, this);
        ServiceType sType = getServiceType(item.attributeSets);
        if(sType!=null && sType.getDisplayName()!=null)
            setTitle("Service UI for "+sType.getDisplayName());
        Container container = getContentPane();
        if(container!=null)
            container.add(serviceUIPanel);
        display(component);
    }
View Full Code Here

TOP

Related Classes of net.jini.lookup.entry.ServiceType

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.