@Override public String getSlingId() { if (settingsService==null) { return null; } return settingsService.getSlingId(); }
private boolean isAuthor() { return slingSettings.getRunModes().contains("author"); } }
private boolean isAuthor() { return slingSettings.getRunModes().contains("author"); } }
/** * Activate this component. */ @Activate protected void activate() { // Set the application id and the thread pool Environment.APPLICATION_ID = this.settingsService.getSlingId(); Environment.THREAD_POOL = this.threadPool; }
@Override public boolean isOnAuthor() { return settingsService.getRunModes().contains(RUNMODE_AUTHOR); }
@Activate protected void activate() { slingId = settingsService.getSlingId(); }
@Override public boolean isOnAuthor() { return settingsService.getRunModes().contains(RUNMODE_AUTHOR); }
/** * Try to get the service and the Sling ID */ private synchronized void retainService() { final ServiceReference reference = bundleContext.getServiceReference(SETTINGS_NAME); if ( reference != null ) { final SlingSettingsService service = (SlingSettingsService)bundleContext.getService(reference); if ( service != null ) { QuartzJobExecutor.SLING_ID = service.getSlingId(); this.bundleContext.ungetService(reference); // stop the listener, we don't need it anymore this.stop(); } } }
private boolean isAuthor() { return slingSettings.getRunModes().contains("author"); }
@Activate protected void activate(final ComponentContext context) { this.slingId = slingSettingsService.getSlingId(); this.context = context; if (logger.isDebugEnabled()) { logger.debug("activated. slingid=" + slingId + ", discoveryservice=" + discoveryService); } registerEventHandler(); }
@Activate public void activate(MyServiceConfiguration config) { author = settings.getRunModes().contains("author"); }
@PostConstruct protected void init() { log.info("Reached init of HelloWorldModel"); message = "\tHello World!\n"; message += "\tThis is instance: " + settings.getSlingId() + "\n"; message += "\tResource type is: " + resourceType + "\n"; message += "\tUser id is " + resourceResolver.getUserID() + "\n"; }
@Activate public void activate() { runmodes = slingSettingsService.getRunModes(); author = runmodes.contains("author"); publish = runmodes.contains("publish"); }
@Activate protected void activate(ComponentContext context) { synchronized(lock) { this.context = context; slingId = getSlingSettingsService().getSlingId(); NAME = "discovery.connectors.common.runner." + slingId; doActivate(); activated = true; issueHeartbeat(); } }
//quickfix //FrameworkUtil.getBundle(NodeManageDAO.class).getBundleContext() BundleContext bundleContext = FrameworkUtil.getBundle(PhotoNodeManagerDAO.class).getBundleContext(); ServiceReference serviceReference = bundleContext.getServiceReference(SlingSettingsService.class.getName( )); SlingSettingsService slingSettingsService = (SlingSettingsService)bundleContext.getService(serviceReference); Set<String> runmode= slingSettingsService.getRunModes(); //just in author mode if(runmode.contains("author")) { //attention replication from author is not working without nullable / delete the cq:distribute property node.setProperty("cq:distribute", (Value)null); }
public static synchronized void configure(SlingSettingsService slingSettings) throws ConfigurationException { runmodes = slingSettings.getRunModes(); isAuthor = runmodes.contains(Externalizer.AUTHOR); isPublish = runmodes.contains(Externalizer.PUBLISH); if (isAuthor && isPublish) { throw new ConfigurationException(null, "Either 'author' or 'publish' run modes may be specified, not both."); } }
public static synchronized void configure(SlingSettingsService slingSettings) throws ConfigurationException { runmodes = slingSettings.getRunModes(); isAuthor = runmodes.contains(Externalizer.AUTHOR); isPublish = runmodes.contains(Externalizer.PUBLISH); if (isAuthor && isPublish) { throw new ConfigurationException(null, "Either 'author' or 'publish' run modes may be specified, not both."); } }
@SuppressWarnings("deprecation") @Activate private void activate(ComponentContext componentContext, Config config) { // Activate only in author mode, and check enabled status in service configuration as well enabled = !RunMode.disableIfNotAuthor(slingSettings.getRunModes(), componentContext, log) && config.enabled(); }
@SuppressWarnings("null") private String getLinkUrlPrefix(UrlMode urlMode, Page targetPage) { UrlMode mode = ObjectUtils.defaultIfNull(urlMode, urlHandlerConfig.getDefaultUrlMode()); return mode.getLinkUrlPrefix(self, slingSettings.getRunModes(), currentPage, targetPage); }
@SuppressWarnings("null") private String getResourceUrlPrefix(UrlMode urlMode, Resource targetResource) { UrlMode mode = ObjectUtils.defaultIfNull(urlMode, urlHandlerConfig.getDefaultUrlMode()); return mode.getResourceUrlPrefix(self, slingSettings.getRunModes(), currentPage, targetResource); }