/** * Test if a target is a remote component. */ protected boolean isSamePlatform(IComponentIdentifier source, IComponentIdentifier target) { return source==null || (target!=null && source.getPlatformName().equals(target.getPlatformName())); } }
/** * Init the transport. * @param platform The platform. * @param settings The settings. */ public LocalTransport(IServiceProvider container) { this.container = container; this.addresses = new String[]{SCHEMAS[0]+container.getId().getPlatformName()}; }
/** * Init the transport. * @param platform The platform. * @param settings The settings. */ public LocalTransport(IServiceProvider container) { this.container = container; this.addresses = new String[]{SCHEMAS[0]+container.getId().getPlatformName()}; }
/** * Init the transport. */ public LocalTransport(IInternalAccess component) { this.component = component; this.addresses = new String[]{SCHEMAS[0]+component.getComponentIdentifier().getPlatformName()}; }
/** * Test if a component identifier is a remote component. */ protected boolean isRemoteComponent(IComponentIdentifier cid) { return !cid.getPlatformName().equals(root.getComponentIdentifier().getName()); }
/** * Test if a component identifier is a remote component. */ protected boolean isRemoteComponent(IComponentIdentifier cid) { return !cid.getPlatformName().equals(root.getComponentIdentifier().getName()); }
/** * Test if a component identifier is a remote component. */ protected boolean isRemoteComponent(IComponentIdentifier cid) { return !cid.getPlatformName().equals(agent.getComponentIdentifier().getName()); }
/** * Test if a component identifier is a remote component. */ protected boolean isRemoteComponent(IComponentIdentifier cid) { return !cid.getPlatformName().equals(root.getComponentIdentifier().getName()); }
/** * Test if a transport is applicable for the target address. * * @return True, if the transport is applicable for the address. */ public boolean isApplicable(String address) { boolean applicable = false; for(int i=0; !applicable && i<getServiceSchemas().length; i++) { applicable = address.startsWith(getServiceSchemas()[i]) && address.substring(getServiceSchemas()[i].length()).equals(component.getComponentIdentifier().getPlatformName()); } return applicable; }
/** * Test if a transport is applicable for the target address. * * @return True, if the transport is applicable for the address. */ public boolean isApplicable(String address) { boolean applicable = false; for(int i=0; !applicable && i<getServiceSchemas().length; i++) { applicable = address.startsWith(getServiceSchemas()[i]) && address.substring(getServiceSchemas()[i].length()).equals(container.getId().getPlatformName()); } return applicable; }
/** * Test if a transport is applicable for the target address. * * @return True, if the transport is applicable for the address. */ public boolean isApplicable(String address) { boolean applicable = false; for(int i=0; !applicable && i<getServiceSchemas().length; i++) { applicable = address.startsWith(getServiceSchemas()[i]) && address.substring(getServiceSchemas()[i].length()).equals(container.getId().getPlatformName()); } return applicable; }
public void actionPerformed(ActionEvent e) { addSelectedAgent(new ComponentIdentifier("@"+access.getComponentIdentifier().getPlatformName(), (String[])null), list); } });
public Object preProcess(IContext context, Object object) { try { IComponentIdentifier src = (IComponentIdentifier)object; ComponentIdentifier ret = null; if(src.getPlatformName().equals(root.getLocalName())) { String[] addresses = ((MessageService)msgservice).internalGetAddresses(); ret = new ComponentIdentifier(src.getName(), addresses); // System.out.println("Rewritten cid: "+ret); } return ret==null? src: ret; } catch(RuntimeException e) { e.printStackTrace(); throw e; } } };
/** * Create a transport component identifier. * @param The component identifier. * @return The transport component identifier. */ public IFuture<ITransportComponentIdentifier> getTransportComponentIdentifier(IComponentIdentifier component) { Future<ITransportComponentIdentifier> ret = new Future<ITransportComponentIdentifier>(); ITransportComponentIdentifier res = addresses.getTransportComponentIdentifier(component); if(res!=null) { ret.setResult(res); } else { ret.setException(new RuntimeException("Not contained: "+component.getPlatformName())); } return ret; }
public void customResultAvailable(Object result) { window.getStatusBar().setText("Saved platform settings for: "+pcc.getPlatformAccess().getComponentIdentifier().getPlatformName()); pcc.dispose(); } public void customExceptionOccurred(Exception exception)
public Object process(Object object, Class<?> clazz, List<ITraverseProcessor> processors, Traverser traverser, Map<Object, Object> traversed, boolean clone, ClassLoader targetcl, Object context) { try { IComponentIdentifier src = (IComponentIdentifier)object; ComponentIdentifier ret = null; if(src.getPlatformName().equals(component.getComponentIdentifier().getRoot().getLocalName())) { String[] addresses = ((MessageService)msgservice).internalGetAddresses(); ret = new ComponentIdentifier(src.getName(), addresses); } return ret==null? src: ret; } catch(RuntimeException e) { e.printStackTrace(); throw e; } } };
public void customResultAvailable(Object result) { window.getStatusBar().setText("Saved platform settings for: "+pcc.getPlatformAccess().getComponentIdentifier().getPlatformName()); pcc.dispose(); } public void customExceptionOccurred(Exception exception)
/** * Update component identifier. * @param cid The component identifier. * @return The component identifier. */ public IComponentIdentifier internalUpdateComponentIdentifier(IComponentIdentifier cid) { ComponentIdentifier ret = null; if(cid.getPlatformName().equals(component.getComponentIdentifier().getRoot().getLocalName())) { ret = new ComponentIdentifier(cid.getName(), internalGetAddresses()); // System.out.println("Rewritten cid: "+ret+" :"+SUtil.arrayToString(ret.getAddresses())); } return ret==null? cid: ret; }
/** * Update component identifier. * @param cid The component identifier. * @return The component identifier. */ public IComponentIdentifier internalUpdateComponentIdentifier(IComponentIdentifier cid) { ComponentIdentifier ret = null; if(cid.getPlatformName().equals(component.getComponentIdentifier().getRoot().getLocalName())) { ret = new ComponentIdentifier(cid.getName(), internalGetAddresses()); // System.out.println("Rewritten cid: "+ret+" :"+SUtil.arrayToString(ret.getAddresses())); } return ret==null? cid: ret; }
/** * The time services are searched and added at agent startup. */ @AgentService(isquery=true) public void addTimeService(ITimeService timeservice) { ISubscriptionIntermediateFuture<String> subscription = timeservice.subscribe(); while(subscription.hasNextIntermediateResult()) { String time = subscription.getNextIntermediateResult(); String platform = ((IService)timeservice).getServiceIdentifier().getProviderId().getPlatformName(); System.out.println("New time received from "+platform+" at "+timeservice.getLocation()+": "+time); } }