public AdminRestletResource() { _helixMirrorMakerManager = (HelixMirrorMakerManager) getApplication().getContext() .getAttributes().get(HelixMirrorMakerManager.class.toString()); }
public TopicManagementRestletResource() { getVariants().add(new Variant(MediaType.TEXT_PLAIN)); getVariants().add(new Variant(MediaType.APPLICATION_JSON)); setNegotiated(false); _helixMirrorMakerManager = (HelixMirrorMakerManager) getApplication().getContext() .getAttributes().get(HelixMirrorMakerManager.class.toString()); _autoTopicWhitelistingManager = (AutoTopicWhitelistingManager) getApplication().getContext() .getAttributes().get(AutoTopicWhitelistingManager.class.toString()); if (getApplication().getContext().getAttributes() .containsKey(KafkaBrokerTopicObserver.class.toString())) { _srcKafkaBrokerTopicObserver = (KafkaBrokerTopicObserver) getApplication().getContext() .getAttributes().get(KafkaBrokerTopicObserver.class.toString()); } else { _srcKafkaBrokerTopicObserver = null; } }
public ValidationRestletResource() { getVariants().add(new Variant(MediaType.TEXT_PLAIN)); getVariants().add(new Variant(MediaType.APPLICATION_JSON)); setNegotiated(false); _validationManager = (ValidationManager) getApplication().getContext() .getAttributes().get(ValidationManager.class.toString()); if (getApplication().getContext().getAttributes() .containsKey(SourceKafkaClusterValidationManager.class.toString())) { _srcKafkaValidationManager = (SourceKafkaClusterValidationManager) getApplication().getContext() .getAttributes().get(SourceKafkaClusterValidationManager.class.toString()); } else { _srcKafkaValidationManager = null; } }
public static Context getCurrentApplicationContext() { Application application = Application.getCurrent(); if (application == null) { return null; } return application.getContext(); }
public TopicParitionOffsetRestletResource() { _helixMirrorMakerManager = (HelixMirrorMakerManager) getApplication().getContext() .getAttributes().get(HelixMirrorMakerManager.class.toString()); }
public AdminRestletResource() { _helixMirrorMakerManager = (HelixMirrorMakerManager) getApplication().getContext() .getAttributes().get(HelixMirrorMakerManager.class.toString()); }
public MirrorMakerManagerRestletResource() { _helixMirrorMakerManager = (HelixMirrorMakerManager) getApplication().getContext() .getAttributes().get(HelixMirrorMakerManager.class.toString()); }
/** * Sets the inbound root Restlet. * * @param inboundRoot * The inbound root Restlet. */ public synchronized void setInboundRoot(Restlet inboundRoot) { this.inboundRoot = inboundRoot; if ((inboundRoot != null) && (inboundRoot.getContext() == null)) { inboundRoot.setContext(getContext()); } }
/** * Called by OSGi DS to inject the router provider service * * @param routerProvider * the router provider service */ public void bindRouterProvider(RouterProvider routerProvider) { this.routerProvider = routerProvider; if (application != null) application.setInboundRoot(routerProvider .getInboundRoot(application.getContext())); }
/** * Sets the outbound root Restlet. * * @param outboundRoot * The outbound root Restlet. */ public synchronized void setOutboundRoot(Restlet outboundRoot) { this.outboundRoot = outboundRoot; if ((outboundRoot != null) && (outboundRoot.getContext() == null)) { outboundRoot.setContext(getContext()); } }
public TopicManagementRestletResource() { getVariants().add(new Variant(MediaType.TEXT_PLAIN)); getVariants().add(new Variant(MediaType.APPLICATION_JSON)); setNegotiated(false); _conf = (ManagerConf) getApplication().getContext().getAttributes().get(ManagerConf.class.toString()); _helixMirrorMakerManager = (ControllerHelixManager) getApplication().getContext() .getAttributes().get(ControllerHelixManager.class.toString()); SourceKafkaClusterValidationManager srcKafkaValidationManager = (SourceKafkaClusterValidationManager) getApplication() .getContext().getAttributes().get(SourceKafkaClusterValidationManager.class.toString()); _clusterToObserverMap = srcKafkaValidationManager.getClusterToObserverMap(); }
public ValidationRestletResource() { getVariants().add(new Variant(MediaType.TEXT_PLAIN)); getVariants().add(new Variant(MediaType.APPLICATION_JSON)); setNegotiated(false); _validationManager = (ValidationManager) getApplication().getContext() .getAttributes().get(ValidationManager.class.toString()); if (getApplication().getContext().getAttributes() .containsKey(SourceKafkaClusterValidationManager.class.toString())) { _srcKafkaValidationManager = (SourceKafkaClusterValidationManager) getApplication().getContext() .getAttributes().get(SourceKafkaClusterValidationManager.class.toString()); } else { _srcKafkaValidationManager = null; } }
public TopicManagementRestletResource() { getVariants().add(new Variant(MediaType.TEXT_PLAIN)); getVariants().add(new Variant(MediaType.APPLICATION_JSON)); setNegotiated(false); _managerControllerHelix = (ManagerControllerHelix) getApplication().getContext() .getAttributes().get(ManagerControllerHelix.class.toString()); _helixMirrorMakerManager = (HelixMirrorMakerManager) getApplication().getContext() .getAttributes().get(HelixMirrorMakerManager.class.toString()); _autoTopicWhitelistingManager = (AutoTopicWhitelistingManager) getApplication().getContext() .getAttributes().get(AutoTopicWhitelistingManager.class.toString()); if (getApplication().getContext().getAttributes() .containsKey(KafkaBrokerTopicObserver.class.toString())) { _srcKafkaBrokerTopicObserver = (KafkaBrokerTopicObserver) getApplication().getContext() .getAttributes().get(KafkaBrokerTopicObserver.class.toString()); } else { _srcKafkaBrokerTopicObserver = null; } }
public AdminRestletResource() { getVariants().add(new Variant(MediaType.TEXT_PLAIN)); getVariants().add(new Variant(MediaType.APPLICATION_JSON)); setNegotiated(false); _helixMirrorMakerManager = (ControllerHelixManager) getApplication().getContext() .getAttributes().get(ControllerHelixManager.class.toString()); }
Application app = getApplication(); if (app != null) { applicationContext = app.getContext();
(ConcurrentHashMap<String, Future<?>>) this.getApplication().getContext().getAttributes().get( "asyncOperationStatuses"); if (opStatuses.get(id) != null) {
@Override protected Application createApplication(Context context) { Application application = super.createApplication(context); /* Retrieve the application context in order to populate it with relevant variables. */ Context applicationContext = application.getContext(); /* Retrieve the component manager and make it available in the restlet application context. */ ComponentManager componentManager = (ComponentManager) getServletContext().getAttribute("org.xwiki.component.manager.ComponentManager"); applicationContext.getAttributes().put(Constants.XWIKI_COMPONENT_MANAGER, componentManager); /* Set the object factory for instantiating components. */ if (application instanceof XWikiRestletJaxRsApplication) { XWikiRestletJaxRsApplication jaxrsApplication = (XWikiRestletJaxRsApplication) application; jaxrsApplication.setObjectFactory(new ComponentsObjectFactory(componentManager)); } else { log("The Restlet application is not an instance of XWikiRestletJaxRsApplication. Please check your web.xml"); } return application; }
final Context applicationContext = application.getContext();
final Context applicationContext = application.getContext();
@Override public Restlet createChain(Application application) { final Context context = application.getContext(); // v1 has gzip compression // can be disabled by parameter application.getEncoderService().setEnabled(ContextUtils.getParameterAsBoolean(context, Constants.V1_COMPRESSION_PARAMETER, true)); Filter encoder = application.getEncoderService().createInboundFilter(context); encoder.setName("Response encoder"); encoder.setDescription("Allows Ontopia API call responses to be compressed"); // under compression, router Router router = new Router(context); router.setName("v1 main router"); encoder.setNext(router); router.attach("/topicmaps/{topicmap}", new TopicMapRouter(context)); return encoder; } };