Java 类com.liferay.portal.kernel.util.HashMapDictionary 实例源码

项目:arquillian-liferay    文件:PortalURLBundleActivator.java   
@Override
public void start(BundleContext context) throws Exception {
    _companyLocalServiceServiceReference = context.getServiceReference(
        CompanyLocalService.class);

    CompanyLocalService companyLocalService = null;

    if (_companyLocalServiceServiceReference == null) {
        throw new IllegalStateException(
            "Can not access CompanyLocalService");
    }

    companyLocalService = context.getService(
        _companyLocalServiceServiceReference);

    _groupLocalServiceServiceReference = context.getServiceReference(
        GroupLocalService.class);

    GroupLocalService groupLocalService = null;

    if (_groupLocalServiceServiceReference == null) {
        throw new IllegalStateException("Can not access GroupLocalService");
    }

    groupLocalService = context.getService(
        _groupLocalServiceServiceReference);

    _layoutLocalServiceServiceReference = context.getServiceReference(
        LayoutLocalService.class);

    LayoutLocalService layoutLocalService = null;

    if (_layoutLocalServiceServiceReference == null) {
        throw new IllegalStateException(
            "Can not access LayoutLocalService");
    }

    layoutLocalService = context.getService(
        _layoutLocalServiceServiceReference);

    _portletPreferencesLocalServiceServiceReference =
        context.getServiceReference(PortletPreferencesLocalService.class);

    PortletPreferencesLocalService portletPreferencesLocalService = null;

    if (_portletPreferencesLocalServiceServiceReference == null) {
        throw new IllegalStateException(
            "Can not access PortletPreferencesLocalService");
    }

    portletPreferencesLocalService = context.getService(
        _portletPreferencesLocalServiceServiceReference);

    _userLocalServiceServiceReference = context.getServiceReference(
        UserLocalService.class);

    UserLocalService userLocalService = null;

    if (_userLocalServiceServiceReference == null) {
        throw new IllegalStateException("Can not access UserLocalService");
    }

    userLocalService = context.getService(
        _userLocalServiceServiceReference);

    PortalURLServlet portalURLServlet = new PortalURLServlet(
        companyLocalService, groupLocalService, layoutLocalService,
        portletPreferencesLocalService, userLocalService);

    Dictionary<String, Object> properties = new HashMapDictionary<>();

    properties.put(
        "osgi.http.whiteboard.servlet.name", "Install Portlet Servlet");

    properties.put(
        "osgi.http.whiteboard.servlet.pattern",
        "/install-portlet-servlet/*");

    _servletServiceRegistration = context.registerService(
        Servlet.class, portalURLServlet, properties);
}
项目:arquillian-extension-liferay    文件:PortalURLBundleActivator.java   
@Override
public void start(BundleContext context) throws Exception {
    _companyLocalServiceServiceReference = context.getServiceReference(
        CompanyLocalService.class);

    CompanyLocalService companyLocalService;

    if (_companyLocalServiceServiceReference == null) {
        throw new IllegalStateException(
            "Can not access CompanyLocalService");
    }

    companyLocalService = context.getService(
        _companyLocalServiceServiceReference);

    _groupLocalServiceServiceReference = context.getServiceReference(
        GroupLocalService.class);

    GroupLocalService groupLocalService;

    if (_groupLocalServiceServiceReference == null) {
        throw new IllegalStateException("Can not access GroupLocalService");
    }

    groupLocalService = context.getService(
        _groupLocalServiceServiceReference);

    _layoutLocalServiceServiceReference = context.getServiceReference(
        LayoutLocalService.class);

    LayoutLocalService layoutLocalService;

    if (_layoutLocalServiceServiceReference == null) {
        throw new IllegalStateException(
            "Can not access LayoutLocalService");
    }

    layoutLocalService = context.getService(
        _layoutLocalServiceServiceReference);

    _portletPreferencesLocalServiceServiceReference =
        context.getServiceReference(PortletPreferencesLocalService.class);

    PortletPreferencesLocalService portletPreferencesLocalService;

    if (_portletPreferencesLocalServiceServiceReference == null) {
        throw new IllegalStateException(
            "Can not access PortletPreferencesLocalService");
    }

    portletPreferencesLocalService = context.getService(
        _portletPreferencesLocalServiceServiceReference);

    _userLocalServiceServiceReference = context.getServiceReference(
        UserLocalService.class);

    UserLocalService userLocalService;

    if (_userLocalServiceServiceReference == null) {
        throw new IllegalStateException("Can not access UserLocalService");
    }

    userLocalService = context.getService(
        _userLocalServiceServiceReference);

    PortalURLServlet portalURLServlet = new PortalURLServlet(
        companyLocalService, groupLocalService, layoutLocalService,
        portletPreferencesLocalService, userLocalService);

    Dictionary<String, Object> properties = new HashMapDictionary<>();

    properties.put(
        "osgi.http.whiteboard.servlet.name", "Install Portlet Servlet");

    properties.put(
        "osgi.http.whiteboard.servlet.pattern",
        "/install-portlet-servlet/*");

    _servletServiceRegistration = context.registerService(
        Servlet.class, portalURLServlet, properties);
}
项目:ch-inofix-timetracker    文件:BackgroundTaskExecutorConfigurator.java   
protected void registerBackgroundTaskExecutor(BundleContext bundleContext,
        BackgroundTaskExecutor backgroundTaskExecutor) {

    Dictionary<String, Object> properties = new HashMapDictionary<>();

    Class<?> clazz = backgroundTaskExecutor.getClass();

    properties.put("background.task.executor.class.name", clazz.getName());

    ServiceRegistration<BackgroundTaskExecutor> serviceRegistration = bundleContext
            .registerService(BackgroundTaskExecutor.class, backgroundTaskExecutor, properties);

    _serviceRegistrations.add(serviceRegistration);
}
项目:ch-inofix-contact-manager    文件:BackgroundTaskExecutorConfigurator.java   
protected void registerBackgroundTaskExecutor(BundleContext bundleContext,
        BackgroundTaskExecutor backgroundTaskExecutor) {

    Dictionary<String, Object> properties = new HashMapDictionary<>();

    Class<?> clazz = backgroundTaskExecutor.getClass();

    properties.put("background.task.executor.class.name", clazz.getName());

    ServiceRegistration<BackgroundTaskExecutor> serviceRegistration = bundleContext
            .registerService(BackgroundTaskExecutor.class, backgroundTaskExecutor, properties);

    _serviceRegistrations.add(serviceRegistration);
}
项目:ch-inofix-data-manager    文件:BackgroundTaskExecutorConfigurator.java   
protected void registerBackgroundTaskExecutor(BundleContext bundleContext,
        BackgroundTaskExecutor backgroundTaskExecutor) {

    Dictionary<String, Object> properties = new HashMapDictionary<>();

    Class<?> clazz = backgroundTaskExecutor.getClass();

    properties.put("background.task.executor.class.name", clazz.getName());

    ServiceRegistration<BackgroundTaskExecutor> serviceRegistration = bundleContext
            .registerService(BackgroundTaskExecutor.class, backgroundTaskExecutor, properties);

    _serviceRegistrations.add(serviceRegistration);
}