• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ServiceID类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.jini.core.lookup.ServiceID的典型用法代码示例。如果您正苦于以下问题:Java ServiceID类的具体用法?Java ServiceID怎么用?Java ServiceID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ServiceID类属于net.jini.core.lookup包,在下文中一共展示了ServiceID类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getSpaceDirect

import net.jini.core.lookup.ServiceID; //导入依赖的package包/类
public IJSpace getSpaceDirect(ServiceID serviceID) throws RemoteException {
    if (puDetails == null) {
        throw new RemoteException("processing unit shutdown");
    }
    for (Object serviceDetails : puDetails.getDetails()) {
        if (isSpaceServiceDetails(serviceDetails)) {
            try {
                if (containsEmbeddedSpace(serviceDetails)) {
                    Method spaceServiceId = serviceDetails.getClass().getMethod("getServiceID");
                    if (spaceServiceId.invoke(serviceDetails).equals(serviceID)) {
                        Field spaceDetails = serviceDetails.getClass().getDeclaredField("directSpace");
                        spaceDetails.setAccessible(true);
                        return (IJSpace) spaceDetails.get(serviceDetails);
                    }
                }
            } catch (Exception e) {
                throw new RemoteException("Failed to get space", e);
            }
        }
    }
    return null;
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:23,代码来源:PUServiceBeanImpl.java


示例2: getSpaceRuntimeHolder

import net.jini.core.lookup.ServiceID; //导入依赖的package包/类
public RuntimeHolder getSpaceRuntimeHolder(ServiceID serviceID) throws RemoteException {
    if (puDetails == null) {
        throw new RemoteException("processing unit shutdown");
    }
    for (Object serviceDetails : puDetails.getDetails()) {
        if (isSpaceServiceDetails(serviceDetails)) {
            try {
                if (containsEmbeddedSpace(serviceDetails)) {
                    Method spaceServiceId = serviceDetails.getClass().getMethod("getServiceID");
                    if (spaceServiceId.invoke(serviceDetails).equals(serviceID)) {
                        Field spaceDetails = serviceDetails.getClass().getDeclaredField("directSpaceAdmin");
                        spaceDetails.setAccessible(true);
                        IInternalRemoteJSpaceAdmin spaceAdmin = (IInternalRemoteJSpaceAdmin) spaceDetails.get(serviceDetails);
                        return spaceAdmin.getRuntimeHolder();
                    }
                }
            } catch (Exception e) {
                throw new RemoteException("Failed to get runtime holder", e);
            }
        }
    }
    return null;
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:24,代码来源:PUServiceBeanImpl.java


示例3: getSpaceStatisticsHolder

import net.jini.core.lookup.ServiceID; //导入依赖的package包/类
public StatisticsHolder getSpaceStatisticsHolder(ServiceID serviceID) throws RemoteException {
    if (puDetails == null) {
        throw new RemoteException("processing unit shutdown");
    }
    for (Object serviceDetails : puDetails.getDetails()) {
        if (isSpaceServiceDetails(serviceDetails)) {
            try {
                if (containsEmbeddedSpace(serviceDetails)) {
                    Method spaceServiceId = serviceDetails.getClass().getMethod("getServiceID");
                    if (spaceServiceId.invoke(serviceDetails).equals(serviceID)) {
                        Field spaceDetails = serviceDetails.getClass().getDeclaredField("directSpaceAdmin");
                        spaceDetails.setAccessible(true);
                        IInternalRemoteJSpaceAdmin spaceAdmin = (IInternalRemoteJSpaceAdmin) spaceDetails.get(serviceDetails);
                        return ((StatisticsAdmin) spaceAdmin).getHolder();
                    }
                }
            } catch (Exception e) {
                throw new RemoteException("Failed to get statistics holder", e);
            }
        }
    }
    return null;
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:24,代码来源:PUServiceBeanImpl.java


示例4: getServiceItem

import net.jini.core.lookup.ServiceID; //导入依赖的package包/类
public ServiceItem getServiceItem(ServiceID serviceID) {
	Collection<List<ServiceItem>> c = interfaceListMap.values();
	if (c == null)
		return null;
	List<ServiceItem> sItems;
	ServiceItem sItem;
	for (Iterator<List<ServiceItem>> it = c.iterator(); it.hasNext();) {
		sItems = it.next();
		for (int i = 0; i < sItems.size(); i++) {
			if (serviceID.equals((sItems.get(i)).serviceID)) {
				sItem = sItems.remove(i);
				sItems.add(sItem);
				return sItem;
			}
		}
	}
	return null;
}
 
开发者ID:mwsobol,项目名称:SORCER,代码行数:19,代码来源:ServiceCataloger.java


示例5: removeFromTree

import net.jini.core.lookup.ServiceID; //导入依赖的package包/类
private void removeFromTree(ServiceID sid) {
	int nServices = _root.getChildCount();
	// System.out.println("removeFromTree() checking "+nServices+"
	// services");

	for (int i = 0; i < nServices; i++) {
		// System.out.println("Checking "+i);

		DefaultMutableTreeNode service = (DefaultMutableTreeNode) _root
				.getChildAt(i);
		ServiceNode sNode = (ServiceNode) service.getUserObject();
		// System.out.println("Checking "+sNode);
		if (sNode.sameServiceID(sid)) {
			DefaultTreeModel model = (DefaultTreeModel) _tree.getModel();
			model.removeNodeFromParent(service);
			return;
		}

	}
}
 
开发者ID:mwsobol,项目名称:SORCER,代码行数:21,代码来源:LusTree.java


示例6: create

import net.jini.core.lookup.ServiceID; //导入依赖的package包/类
MethodAnalytics create(ServiceID serviceID, String hostName) {
    String activeOps = "";
    synchronized (stopWatch) {
        if (stopWatch.size() > 0) {
            StringBuilder b = new StringBuilder();
            for (Integer i : stopWatch.keySet()) {
                if (b.length() > 0)
                    b.append(", ");
                b.append(Integer.toString(i));
            }
            activeOps = b.toString();
        }
    }
    return new MethodAnalytics(activeOps,
                               averageExecTime,
                               completed.get(),
                               failed.get(),
                               hostName,
                               methodName,
                               numActiveOperations.get(),
                               serviceID,
                               totalCallTime.get(),
                               totalOperationCalls.get());
}
 
开发者ID:mwsobol,项目名称:SORCER,代码行数:25,代码来源:MethodInvocationRecord.java


示例7: unProvision

import net.jini.core.lookup.ServiceID; //导入依赖的package包/类
public void unProvision(ServiceID serviceId) throws ProvisioningException {
    ServiceItem[] serviceItems = Accessor.get().getServiceItems(new ServiceTemplate(serviceId, null, null), null);
    OperationalStringEntry opStringEntry = null;
    if(serviceItems.length>0)
        opStringEntry = AttributesUtil.getFirstByType(serviceItems[0].attributeSets, OperationalStringEntry.class);
    if (opStringEntry == null)
        throw new IllegalArgumentException("Service was not provisioned");
    ServiceItem[] provisionMonitors = Accessor.get().getServiceItems(new ServiceTemplate(null, new Class[]{ProvisionMonitor.class}, null),
                                                                     null);
    for (ServiceItem monitor : provisionMonitors) {
        try {
            ((DeployAdmin) ((ProvisionMonitor) monitor.service).getAdmin()).undeploy(opStringEntry.name);
            return;
        } catch (OperationalStringException ignored) {
            //deploy admin does not know our service, try another one
        } catch (RemoteException e) {
        }
    }
    throw new ProvisioningException("No DeployAdmin is able to undeploy service " + serviceId);
}
 
开发者ID:mwsobol,项目名称:SORCER,代码行数:21,代码来源:ServiceDirectoryProvisioner.java


示例8: MethodAnalytics

import net.jini.core.lookup.ServiceID; //导入依赖的package包/类
public MethodAnalytics(String activeOperations,
                       double averageExecTime,
                       int completed,
                       int failed,
                       String hostName,
                       String methodName,
                       int numActiveOperations,
                       ServiceID serviceID,
                       long totalCallTime,
                       int totalOperationCalls) {
    this.activeOperations = activeOperations;
    this.averageExecTime = averageExecTime;
    this.completed = completed;
    this.failed = failed;
    this.hostName = hostName;
    this.methodName = methodName;
    this.numActiveOperations = numActiveOperations;
    this.serviceID = serviceID;
    this.totalCallTime = totalCallTime;
    this.totalOperationCalls = totalOperationCalls;
}
 
开发者ID:mwsobol,项目名称:SORCER,代码行数:22,代码来源:MethodAnalytics.java


示例9: processEventsFromGsm

import net.jini.core.lookup.ServiceID; //导入依赖的package包/类
private void processEventsFromGsm(List<Events> eventsFromGSMs) {
    //go over events after orphaned processing unit instances have been added
    for (Events events : eventsFromGSMs) {
        for (Event event : events.getEvents()) {
            if (event instanceof ServiceFaultDetectionEvent) {
                ServiceFaultDetectionEvent serviceFaultDetectionEvent = (ServiceFaultDetectionEvent)event;
                ServiceID serviceID = serviceFaultDetectionEvent.getServiceID();
                String serviceIdAsString = serviceID.toString();
                ProcessingUnitInstance puInstanceByUID = processingUnitInstances.getInstanceByUID(serviceIdAsString);
                if (puInstanceByUID != null) {
                    //will raise a member alive indicator event (no need to flush)
                    ((InternalProcessingUnitInstance)puInstanceByUID).setMemberAliveIndicatorStatus(serviceFaultDetectionEvent);
                } else {
                    assertStateChangesPermitted();
                    synchronized (DefaultAdmin.this) {
                        Iterator<ProcessingUnitInstance> iterator = removedProcessingUnitInstances.iterator();
                        while (iterator.hasNext()) {
                            ProcessingUnitInstance removedInstance = iterator.next();
                            if (removedInstance.getUid().equals(serviceIdAsString)) {
                                ((InternalProcessingUnitInstance)removedInstance).setMemberAliveIndicatorStatus(serviceFaultDetectionEvent);
                                if (serviceFaultDetectionEvent.isDetectedFailure()) {
                                    iterator.remove();
                                }
                            }
                        }
                    }
                }
            } else if (event instanceof ProvisionLifeCycleEvent) {
                ProvisionLifeCycleEvent provEvent = (ProvisionLifeCycleEvent)event;
                String processingUnitName = provEvent.getProcessingUnitName();
                ProcessingUnit processingUnit = processingUnits.getProcessingUnit(processingUnitName);
                if (processingUnit != null) {
                    ((InternalProcessingUnit)processingUnit).processProvisionEvent(provEvent);
                }
            }
        }
    }
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:39,代码来源:DefaultAdmin.java


示例10: DefaultGridServiceManager

import net.jini.core.lookup.ServiceID; //导入依赖的package包/类
public DefaultGridServiceManager(ServiceID serviceID, GSM gsm, InternalAdmin admin, int agentId, String agentUid, JVMDetails jvmDetails)
        throws RemoteException {
    super(admin, agentId, agentUid, jvmDetails);
    this.serviceID = serviceID;
    this.gsm = gsm;
    this.gsmAdmin = (ProvisionMonitorAdmin) gsm.getAdmin();
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:8,代码来源:DefaultGridServiceManager.java


示例11: DefaultElasticServiceManager

import net.jini.core.lookup.ServiceID; //导入依赖的package包/类
public DefaultElasticServiceManager(ServiceID serviceID, ESM esm, InternalAdmin admin, int agentId, String agentUid, JVMDetails jvmDetails)
throws RemoteException {
    super(admin, agentId, agentUid, jvmDetails);
    this.serviceID = serviceID;
    this.esm = esm;
    this.esmScaleIsInProgressPerProcessingUnit = new ConcurrentHashMap<String, Boolean>();
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:8,代码来源:DefaultElasticServiceManager.java


示例12: getServiceID

import net.jini.core.lookup.ServiceID; //导入依赖的package包/类
public ServiceID getServiceID() {
    return this.serviceID;
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:4,代码来源:DefaultLookupService.java


示例13: DefaultGridServiceAgent

import net.jini.core.lookup.ServiceID; //导入依赖的package包/类
public DefaultGridServiceAgent(ServiceID serviceID, GSA gsa, InternalAdmin admin, AgentProcessesDetails processesDetails, JVMDetails jvmDetails) {
    super(admin, jvmDetails);
    this.serviceID = serviceID;
    this.gsa = gsa;
    this.processesDetails = processesDetails;
    this.gridServiceContainers = new DefaultGridServiceContainers(admin);
    this.gridServiceManagers = new DefaultGridServiceManagers(admin);
    this.lookupServices = new DefaultLookupServices(admin);
    this.elasticServiceManagers = new DefaultElasticServiceManagers(admin);
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:11,代码来源:DefaultGridServiceAgent.java


示例14: getSpaceDirectFactory

import net.jini.core.lookup.ServiceID; //导入依赖的package包/类
@Override
public DirectSpaceProxyFactory getSpaceDirectFactory(ServiceID serviceID) throws RemoteException {
    final IJSpace space = getSpaceDirect(serviceID);
    if (space == null)
        return null;
    DirectSpaceProxyFactoryImpl result = (DirectSpaceProxyFactoryImpl) space.getDirectProxy().getFactory();
    result = result.createCopyWithoutClusterPolicyIfNeeded();
    return result;
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:10,代码来源:PUServiceBeanImpl.java


示例15: PUDetails

import net.jini.core.lookup.ServiceID; //导入依赖的package包/类
public PUDetails(ServiceID gscServiceID, ClusterInfo clusterInfo, BeanLevelProperties beanLevelProperties, Object[] details) {
    this.gscServiceID = gscServiceID;
    this.clusterInfo = clusterInfo;
    this.beanLevelProperties = beanLevelProperties;
    this.details = details;
    if (details == null) {
        this.details = new ServiceDetails[0];
    }
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:10,代码来源:PUDetails.java


示例16: readExternal

import net.jini.core.lookup.ServiceID; //导入依赖的package包/类
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    gscServiceID = (ServiceID) in.readObject();
    clusterInfo = (ClusterInfo) in.readObject();
    int size = in.readInt();
    this.details = new ServiceDetails[size];
    for (int i = 0; i < size; i++) {
        details[i] = in.readObject();
    }
}
 
开发者ID:Gigaspaces,项目名称:xap-openspaces,代码行数:10,代码来源:PUDetails.java


示例17: discarded

import net.jini.core.lookup.ServiceID; //导入依赖的package包/类
public void discarded(DiscoveryEvent e) {
    final ServiceRegistrar[] regs = e.getRegistrars();
    SwingUtilities.invokeLater(wrap(new Runnable() {
        public void run() {
            for (int i = 0; i < regs.length; i++) {
                ServiceID id = regs[i].getServiceID();
                if (lookup != null
                        && id.equals(lookup.getServiceID())) {
                    lookup = null;
                    seqNo = Long.MAX_VALUE;
                }
                for (int j = 0;
                        j < registrars.getMenuComponentCount();
                        j++) {
                    JMenuItem item =
                            (JMenuItem) registrars.getMenuComponent(j);
                    if (item instanceof RegistrarMenuItem
                            && id.equals(((RegistrarMenuItem) item).id)) {
                        item.setSelected(false);
                        registrars.remove(item);
                        if (registrars.getMenuComponentCount() == 0) {
                            addNone(registrars);
                        }
                        break;
                    }
                }
            }
            if (lookup == null) {
                resetTmpl();
            }
        }
    }));
}
 
开发者ID:apache,项目名称:river-container,代码行数:34,代码来源:Browser.java


示例18: lookup

import net.jini.core.lookup.ServiceID; //导入依赖的package包/类
/**
 * Returns a SORCER service provider identified by its service ID.
 * 
 * @param sid
 *            - provider's ID
 * @return a SORCER service provider
 * @throws RemoteException
 */
@Override
public Provider lookup(ServiceID sid) throws RemoteException {
	if (sid == null)
		return null;
	ServiceItem sItem = cinfo.getServiceItem(sid);
	return (sItem != null && sItem.service instanceof Provider) ? (Provider) sItem.service
			: null;
}
 
开发者ID:mwsobol,项目名称:SORCER,代码行数:17,代码来源:ServiceCataloger.java


示例19: serviceDiscarded

import net.jini.core.lookup.ServiceID; //导入依赖的package包/类
public void serviceDiscarded(ServiceID serviceID) {
	synchronized (_tabs) {
		int nt = _tabs.size();
		for (int i = 0; i < nt; i++) {
			((SSBrowserTab) _tabs.get(i)).serviceDiscarded(serviceID);
		}
	}
}
 
开发者ID:mwsobol,项目名称:SORCER,代码行数:9,代码来源:SSBrowserEnvironmentImpl.java


示例20: serviceModified

import net.jini.core.lookup.ServiceID; //导入依赖的package包/类
public void serviceModified(ServiceID serviceID) {
	synchronized (_tabs) {
		int nt = _tabs.size();
		for (int i = 0; i < nt; i++) {
			((SSBrowserTab) _tabs.get(i)).serviceModified(serviceID);
		}
	}
}
 
开发者ID:mwsobol,项目名称:SORCER,代码行数:9,代码来源:SSBrowserEnvironmentImpl.java



注:本文中的net.jini.core.lookup.ServiceID类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SetEntityLinkPacket类代码示例发布时间:2022-05-23
下一篇:
Java AppUser类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap