private boolean isAuthor() { return slingSettings.getRunModes().contains("author"); } }
@Override public String getSlingId() { if (settingsService==null) { return null; } return settingsService.getSlingId(); }
@Activate protected void activate(ComponentContext ctx) { BundleContext bundleContext = ctx.getBundleContext(); // this is less than ideal, but there's no better way to get to the fs classloader's data directory for (Bundle bundle : bundleContext.getBundles()) { if (bundle.getSymbolicName().equals("org.apache.sling.commons.fsclassloader")) { this.fileRoot = new File(slingSettingsService.getSlingHomePath(), "launchpad/felix/bundle"+bundle.getBundleId()+"/data/classes"); break; } } } }
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; }
@Activate protected void activate(ComponentContext ctx) { BundleContext bundleContext = ctx.getBundleContext(); // this is less than ideal, but there's no better way to get to the fs classloader's data directory for (Bundle bundle : bundleContext.getBundles()) { if (bundle.getSymbolicName().equals("org.apache.sling.commons.fsclassloader")) { this.fileRoot = new File(slingSettingsService.getSlingHomePath(), "launchpad/felix/bundle" + bundle.getBundleId() + "/data/classes"); break; } } } }
@Override public boolean isOnAuthor() { return settingsService.getRunModes().contains(RUNMODE_AUTHOR); }
@Activate protected void activate() { slingId = settingsService.getSlingId(); }
invalidateCurrentEstablishedView(); discoveryServiceImpl.handleTopologyChanging(); final String slingHomePath = slingSettingsService==null ? "n/a" : slingSettingsService.getSlingHomePath(); final String endpointsAsString = getEndpointsAsString(); final String readEndpoints = resourceMap.get(PROPERTY_ID_ENDPOINTS, String.class); resourceMap.put(PROPERTY_ID_RUNTIME, runtimeId); final String slingHomePath = slingSettingsService==null ? "n/a" : slingSettingsService.getSlingHomePath(); resourceMap.put(PROPERTY_ID_SLING_HOME_PATH, slingHomePath); final String endpointsAsString = getEndpointsAsString();
@Override public boolean isOnAuthor() { return settingsService.getRunModes().contains(RUNMODE_AUTHOR); }
@Activate protected void activate(final ComponentContext context) { slingId = slingSettingsService.getSlingId(); logger = LoggerFactory.getLogger(this.getClass().getCanonicalName() + "." + slingId); this.context = context; activated = true; // once activated, register the eventHandler so that we can // start receiving and processing votings... registerEventHandler(); logger.info("activated: activated ("+slingId+")"); }
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"); }
/** * 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(); } } }
//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); }
this.ownRootPath = ownRootPath; this.resourceResolverFactory = rrFactory; this.slingId = settings.getSlingId(); this.cleanupPeriod = cleanupPeriod;
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."); } }