/** * Get one service of a type. * (Returns required service proxy). * @param type The class. * @return The corresponding service. */ public static <T> T getLocalService(final IInternalAccess component, final Class<T> type, final String scope) { return getLocalService(component, type, scope, null, true); }
/** * 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) { return getLocalService(component, type, target, true); }
/** * Get one service of a type. * (Returns required service proxy). * @param type The class. * @return The corresponding service. */ public static <T> T getLocalService(final IInternalAccess component, final Class<T> type, final String scope, boolean proxy) { return getLocalService(component, type, scope, null, proxy); }
/** * Get the library service */ protected ILibraryService getLibraryService() { return internalaccess==null? null: SServiceProvider.getLocalService(internalaccess, ILibraryService.class, RequiredServiceInfo.SCOPE_PLATFORM); } }
/** * Get the clock. * @return The clock. */ public IClockService getClock() { return SServiceProvider.getLocalService(agent, IClockService.class, RequiredServiceInfo.SCOPE_PLATFORM); }
/** * 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, Class<T> type) { return getLocalService(component, type, null); }
/** * Get one service of a type. * (Returns required service proxy). * @param type The class. * @return The corresponding service. */ public static <T> T getLocalService(final IInternalAccess component, final ClassInfo type, final String scope) { return getLocalService(component, type, scope, null, true); }
/** * 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) { return getLocalService(component, type, scope, filter, true); }
/** * 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, Class<T> type, final String scope) { return getLocalService(component, type, scope, null); }
/** * 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) { return getLocalService(component, type, scope, filter, true); }
/** * Get one service of a type. * (Returns required service proxy). * @param type The class. * @return The corresponding service. */ public static <T> T getLocalService(final IInternalAccess component, final ClassInfo type, final String scope, boolean proxy) { return getLocalService(component, type, scope, null, proxy); }
/** * Get one service of a type. * (Returns required service proxy). * @param type The class. * @return The corresponding service. */ public static <T> T getLocalService(final IInternalAccess component, final Class<T> type) { return getLocalService(component, type, (String)null, true); }
/** * 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, ClassInfo type) { return getLocalService(component, type, null); }
/** * 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) { return getLocalService(component, type, target, true); }
/** * Get one service of a type. * (Returns required service proxy). * @param type The class. * @return The corresponding service. */ public static <T> T getLocalService(final IInternalAccess component, final ClassInfo type, boolean proxy) { return getLocalService(component, type, (String)null, proxy); }
/** * Get the current time. * The time unit depends on the currently running clock implementation. * For the default system clock, the time value adheres to the time * representation as used by {@link System#currentTimeMillis()}, i.e., * the value of milliseconds passed since 0:00 'o clock, January 1st, 1970, UTC. * For custom simulation clocks, arbitrary representations can be used. * @return The current time. */ public long getTime() { return SServiceProvider.getLocalService(agent, IClockService.class, RequiredServiceInfo.SCOPE_PLATFORM).getTime(); }
/** * */ protected long getTime() { IClockService cs = SServiceProvider.getLocalService(capa.getAgent(), IClockService.class, RequiredServiceInfo.SCOPE_PLATFORM); // todo: capa.getAgent().getComponentFeature().getRequiredService() does not work in init expressions only from plans :-( // IClockService cs = (IClockService)capa.getAgent().getComponentFeature(IRequiredServicesFeature.class).getRequiredService("clockser").get(); return cs.getTime(); }
/** * Get the current time. * The time unit depends on the currently running clock implementation. * For the default system clock, the time value adheres to the time * representation as used by {@link System#currentTimeMillis()}, i.e., * the value of milliseconds passed since 0:00 'o clock, January 1st, 1970, UTC. * For custom simulation clocks, arbitrary representations can be used. * @return The current time. */ public long getTime() { return SServiceProvider.getLocalService(getComponent(), IClockService.class, RequiredServiceInfo.SCOPE_PLATFORM).getTime(); }
/** * Execute the task. */ public IFuture<Void> execute(final ITaskContext context, final IInternalAccess process) { final Future<Void> ret = new Future<Void>(); IClockService clock = SServiceProvider.getLocalService(process, IClockService.class, RequiredServiceInfo.SCOPE_PLATFORM); context.setParameterValue("time", Long.valueOf(clock.getTime())); return ret; }
public IFuture<Void> execute(IInternalAccess ia) { long cur = SServiceProvider.getLocalService(ia, IClockService.class, RequiredServiceInfo.SCOPE_PLATFORM).getTime(); al.setTime(new Time(new Date(cur))); setAlarm(al); return IFuture.DONE; } });