/** * Create a new service identifier. */ public ServiceIdentifier(IComponentIdentifier providerid, Class<?> type, String servicename, IResourceIdentifier rid, String scope) { this(providerid, new ClassInfo(type), servicename, rid, scope); }
public Object convertString(String val, Object context) throws Exception { return new ClassInfo(val); }
/** * Create a new service identifier. */ public ServiceIdentifier(IComponentIdentifier providerid, Class<?> type, String servicename, IResourceIdentifier rid) { this.providerid = providerid; this.type = new ClassInfo(type); this.servicename = servicename; this.rid = rid; }
/** * Create a new service query. */ public ServiceQuery(Class<T> type, String scope, IAsyncFilter<T> filter, IComponentIdentifier owner) { this(new ClassInfo(type), scope, filter, owner); }
/** * Create a new parameter meta info. */ public PropertyMetaInfo(Class<?> clazz, String name, String initialval, String description) { this(new ClassInfo(clazz), name, initialval, description); }
/** * Create a new expression. */ public UnparsedExpression(String name, String classname, String value, String language) { this.name = name; this.clazz = classname!=null? new ClassInfo(classname): null; this.value = value; this.language = language; }
/** * Create a new expression. */ public UnparsedExpression(String name, Class<?> clazz, String value, String language) { this.name = name; this.clazz = clazz!=null? new ClassInfo(clazz.getName()): null; this.value = value; this.language = language; }
/** * Get a service per type. * @param type The interface type. * @return First matching service or null. */ protected <T> T getService(Class<T> type) { Set<T> sers = services==null? null: (Set<T>)services.get(new ClassInfo(type)); return sers==null || sers.size()==0? null: (T)sers.iterator().next(); }
/** * Get the clazz. * @return The clazz. */ public ClassInfo getClazz() { if(clazz==null && getServiceName()!=null) clazz = new ClassInfo(ServiceCallPlan.class.getName()); return clazz; }
/** * Create a new service info. */ public RequiredServiceInfo(String name, Class<?> type, boolean multiple, Class<?> multiplextype, RequiredServiceBinding binding, List<NFRPropertyInfo> nfprops) { this(name, type!=null ? new ClassInfo(SReflect.getClassName(type)) : null, multiple, multiplextype!=null ? new ClassInfo(SReflect.getClassName(multiplextype)) : null, binding, nfprops); }
/** * Create a new service info. */ public ProvidedServiceInfo(String name, Class<?> type, ProvidedServiceImplementation implementation, String scope, PublishInfo publish, List<UnparsedExpression> properties) { this(name, new ClassInfo(SReflect.getClassName(type)), implementation, scope, publish, properties); }
/** * Create a new service info. */ public RequiredServiceInfo(String name, Class<?> type, boolean multiple, Class<?> multiplextype, RequiredServiceBinding binding, List<NFRPropertyInfo> nfprops, Collection<String> tags) { this(name, type!=null ? new ClassInfo(SReflect.getClassName(type)) : null, multiple, multiplextype!=null ? new ClassInfo(SReflect.getClassName(multiplextype)) : null, binding, nfprops, tags); }
/** * Get the parametertypes as classes. * @return the parametertypes. */ public void setParameterTypes(Class<?>[] parametertypes) { this.parametertypes = new ClassInfo[parametertypes.length]; for(int i = 0; i < parametertypes.length; ++i) { // this.parametertypes[i] = new ClassInfo(parametertypes[i].getName()); this.parametertypes[i] = new ClassInfo(SReflect.getClassName(parametertypes[i])); } }
/** * Create a new publish info. * @param pid The publish id, e.g. url. * @param publishtype The publish type. */ public PublishInfo(String pid, String publishtype, Class<?> mapping, UnparsedExpression[] properties) { this.pid = pid; this.publishtype = publishtype; this.mapping = mapping==null? null: new ClassInfo(mapping); this.properties = SUtil.arrayToList(properties); }
/** * Create req service props. */ protected List<NFRPropertyInfo> createNFRProperties(NFRProperty[] nfrp) { List<NFRPropertyInfo> nfprops = new ArrayList<NFRPropertyInfo>(); for(NFRProperty prop: nfrp) { nfprops.add(new NFRPropertyInfo(prop.name(), new ClassInfo(prop.value().getName()), new MethodInfo(prop.methodname(), prop.methodparametertypes()))); } return nfprops; }
/** * Get one service of a type. * (Returns required service proxy). * @param type The class. * @return The corresponding service. */ public static <T> T getLocalService(IComponentIdentifier component, final Class<T> type, final String scope, final IFilter<T> filter) { return SynchronizedServiceRegistry.getRegistry(component.getRoot()).searchService(new ClassInfo(type), component, scope, filter); }
public Object convertString(String val, Object context) throws Exception { ClassInfo ret = new ClassInfo(SReflect.findClass((String)val, ((IModelInfo)((IContext)context).getRootObject()).getAllImports(), ((IContext)context).getClassLoader())); return ret; } };
public Object convertString(String val, Object context) throws Exception { return new ClassInfo(SReflect.findClass((String)val, ((IModelInfo)((IContext)context).getRootObject()).getAllImports(), ((IContext)context).getClassLoader())); } };
public void customResultAvailable(IRemoteServiceManagementService rms) { IFuture<IComponentManagementService> fut = rms.getServiceProxy(agent.getComponentIdentifier(), cid, new ClassInfo(IComponentManagementService.class), RequiredServiceInfo.SCOPE_PLATFORM, null); fut.addResultListener(createResultListener(new DelegationResultListener<IComponentManagementService>(ret))); } }));
/** * Get one service of a type. * (Returns required service proxy). * @param component The internal access. * @param type The class. * @return The corresponding service. */ public static <T> T getLocalService0(final IInternalAccess component, final Class<T> type, final String scope, final IFilter<T> filter, boolean proxy) { checkThreadAccess(component, proxy); T ret = SynchronizedServiceRegistry.getRegistry(component).searchService(new ClassInfo(type), component.getComponentIdentifier(), scope, filter); return proxy && ret!=null? createRequiredProxy(component, ret, type): ret; }