📄 lightweightpeergroup.java
字号:
throw new ServiceNotFoundException("Not implemented"); } } /** * {@inheritDoc} */ public Iterator getRoleMap(ID name) { if (group != null) { return group.getRoleMap(name); } else { // No translation; use the given name in a singleton. return Collections.singletonList(name).iterator(); } } /** * {@inheritDoc} */ public boolean compatible(Element compat) { return group != null && group.compatible(compat); } /** * {@inheritDoc} */ public Module loadModule(ID assignedID, Advertisement impl) throws ProtocolNotSupportedException, PeerGroupException { if (group != null) { return group.loadModule(assignedID, impl); } else { throw new ProtocolNotSupportedException("LightWeightPeerGroup does not implement this operation"); } } /** * {@inheritDoc} */ public Module loadModule(ID assignedID, ModuleSpecID specID, int where) { if (group != null) { return group.loadModule(assignedID, specID, where); } else { return null; } } /** * {@inheritDoc} */ public void publishGroup(String name, String description) throws IOException { if (group != null) { group.publishGroup(name, description); } else { throw new IOException("Not implemented"); } } /** * {@inheritDoc} */ public PeerGroup newGroup(Advertisement pgAdv) throws PeerGroupException { if (group != null) { return group.newGroup(pgAdv); } else { throw new PeerGroupException("Not implemented"); } } /** * {@inheritDoc} */ public PeerGroup newGroup(PeerGroupID gid, Advertisement impl, String name, String description) throws PeerGroupException { if (group != null) { return group.newGroup(gid, impl, name, description); } else { throw new PeerGroupException("Not implemented"); } } /** * {@inheritDoc} */ public PeerGroup newGroup(PeerGroupID gid) throws PeerGroupException { if (group != null) { return group.newGroup(gid); } else { throw new PeerGroupException("Not implemented"); } } /* * shortcuts to the well-known services, in order to avoid calls to lookup. */ /** * {@inheritDoc} */ public RendezVousService getRendezVousService() { if (group != null) { return group.getRendezVousService(); } else { return null; } } /** * {@inheritDoc} */ public EndpointService getEndpointService() { if (group != null) { return group.getEndpointService(); } else { return null; } } /** * {@inheritDoc} */ public ResolverService getResolverService() { if (group != null) { return group.getResolverService(); } else { return null; } } /** * {@inheritDoc} */ public DiscoveryService getDiscoveryService() { if (group != null) { return group.getDiscoveryService(); } else { return null; } } /** * {@inheritDoc} */ public PeerInfoService getPeerInfoService() { if (group != null) { return group.getPeerInfoService(); } else { return null; } } /** * {@inheritDoc} */ public MembershipService getMembershipService() { if (group != null) { return group.getMembershipService(); } else { return null; } } /** * {@inheritDoc} */ public PipeService getPipeService() { if (group != null) { return group.getPipeService(); } else { return null; } } /** * {@inheritDoc} */ public AccessService getAccessService() { if (group != null) { return group.getAccessService(); } else { return null; } } /* * A few convenience methods. This information is available from * the peer and peergroup advertisement. */ /** * {@inheritDoc} */ public PeerGroupID getPeerGroupID() { if (adv != null) { return (PeerGroupID) adv.getID(); } else if (group != null) { return group.getPeerGroupID(); } else { throw new RuntimeException("No PeerGroupID"); } } /** * {@inheritDoc} */ public PeerID getPeerID() { if (group != null) { return group.getPeerID(); } else { throw new RuntimeException("No PeerID"); } } /** * {@inheritDoc} */ public String getPeerGroupName() { if (adv != null) { return adv.getName(); } else if (group != null) { return group.getPeerGroupName(); } else { throw new RuntimeException("No name"); } } /** * {@inheritDoc} */ public String getPeerName() { if (group != null) { return group.getPeerName(); } else { throw new RuntimeException("No name"); } } /** * {@inheritDoc} */ public ConfigParams getConfigAdvertisement() { if (group != null) { return group.getConfigAdvertisement(); } else { throw new RuntimeException("No ConfigAdvertisement"); } } /** * {@inheritDoc} */ public ModuleImplAdvertisement getAllPurposePeerGroupImplAdvertisement() throws Exception { if (group != null) { return group.getAllPurposePeerGroupImplAdvertisement(); } else { throw new RuntimeException("Not implemented"); } } /** * {@inheritDoc} */ public void unref() {} /** * {@inheritDoc} */ public PeerGroup getWeakInterface() { /** * A LightWeightPeerGroup is already a weak reference * that is not shareable, therefore, return self as * a weak reference. **/ return this; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -