public void customResultAvailable(T result) { super.customResultAvailable(SServiceProvider.createRequiredProxy(component, result, type)); } }
public void customIntermediateResultAvailable(T result) { super.customIntermediateResultAvailable(SServiceProvider.createRequiredProxy(component, result, type)); } }
/** * Create a required service proxy. */ protected static <T> T createRequiredProxy(IInternalAccess component, T ser, ClassInfo type) { return createRequiredProxy(component, ser, type.getType(component.getClassLoader())); }
/** * 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 ClassInfo type, final String scope, final IFilter<T> filter, boolean proxy) { checkThreadAccess(component, proxy); T ret = SynchronizedServiceRegistry.getRegistry(component).searchService(type, component.getComponentIdentifier(), scope, filter); return proxy && ret!=null? createRequiredProxy(component, ret, type): 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; }
/** * 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 getLocalService(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); if(ret==null) throw new ServiceNotFoundException(type.getName()); return proxy? createRequiredProxy(component, ret, type): 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 getLocalService(final IInternalAccess component, final Class<T> type, final IComponentIdentifier target, boolean proxy) { checkThreadAccess(component, proxy); T ret = SynchronizedServiceRegistry.getRegistry(component).searchService(new ClassInfo(type), component.getComponentIdentifier(), RequiredServiceInfo.SCOPE_PLATFORM, new IFilter<T>() { public boolean filter(T obj) { return ((IService)obj).getServiceIdentifier().getProviderId().equals(target); } }); if(ret==null) throw new ServiceNotFoundException(type.getName()); return proxy? createRequiredProxy(component, ret, type): 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 getLocalService(final IInternalAccess component, final ClassInfo type, final String scope, final IFilter<T> filter, boolean proxy) { checkThreadAccess(component, proxy); T ret = SynchronizedServiceRegistry.getRegistry(component).searchService(type, component.getComponentIdentifier(), scope, filter); if(ret==null) throw new ServiceNotFoundException(type.getTypeName()); return proxy? createRequiredProxy(component, ret, type): 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 getLocalService(final IInternalAccess component, final ClassInfo type, final IComponentIdentifier target, boolean proxy) { checkThreadAccess(component, proxy); T ret = SynchronizedServiceRegistry.getRegistry(component).searchService(type, component.getComponentIdentifier(), RequiredServiceInfo.SCOPE_PLATFORM, new IFilter<T>() { public boolean filter(T obj) { return ((IService)obj).getServiceIdentifier().getProviderId().equals(target); } }); if(ret==null) throw new ServiceNotFoundException(type.getTypeName()); return proxy? createRequiredProxy(component, ret, type): ret; }
public void customResultAvailable(Void result) { try { for(Object s: component.getComponentFeature(IProvidedServicesFeature.class).getProvidedServices(null)) { if(proxy) { s = createRequiredProxy(component, (IService)s, ((IService)s).getServiceIdentifier().getServiceType().getType(component.getClassLoader())); } ret.addIntermediateResult((IService)s); } ret.setFinished(); } catch(Exception e) { ret.setException(e); } } });
res = createRequiredProxy(component, res, type); ret.setResult(res);
ser = createRequiredProxy(component, ser, type); ret.setResult(ser);
res = createRequiredProxy(component, res, type); ret.setResult(res);
res = createRequiredProxy(component, res, sid.getServiceType().getType(component.getClassLoader())); ret.setResult(res);
ser = createRequiredProxy(component, ser, type); ret.setResult(ser);