Package java.util

Examples of java.util.Dictionary


    pf.addPropertySetNotification(who);
   
    // set up the initial values by calling the validate and apply methods.
    // the map methods are not called as they will have been called
    // at runtime when the user set the property.
    Dictionary d = new Hashtable();
    try {
      xactProperties.getProperties(tc,d,false/*!stringsOnly*/,false/*!defaultsOnly*/);
    } catch (StandardException se) {
      return;
    }
View Full Code Here


    }

    public static ServiceRegistration register(final BundleContext context, final InventoryPrinterManagerImpl manager,
        final InventoryPrinterDescription desc)
    {
        final Dictionary props = new Hashtable();
        props.put(ConsoleConstants.PLUGIN_LABEL, "status-" + desc.getName());
        props.put(ConsoleConstants.PLUGIN_TITLE, desc.getTitle());
        props.put(ConsoleConstants.PLUGIN_CATEGORY, ConsoleConstants.WEB_CONSOLE_CATEGORY);
        return context.registerService(ConsoleConstants.INTERFACE_SERVLET, new ServiceFactory()
        {

            public void ungetService(final Bundle bundle, final ServiceRegistration registration, final Object service)
            {
View Full Code Here

    {
        this.bundleContext = btx;
        this.cfgPrinterTracker = new ServiceTracker(this.bundleContext, InventoryPrinter.SERVICE, this);
        this.cfgPrinterTracker.open();

        final Dictionary props = new Hashtable();
        props.put(ConsoleConstants.PLUGIN_LABEL, ConsoleConstants.NAME);
        props.put(ConsoleConstants.PLUGIN_TITLE, ConsoleConstants.TITLE);
        props.put(ConsoleConstants.PLUGIN_CATEGORY, ConsoleConstants.WEB_CONSOLE_CATEGORY);
        this.pluginRegistration = btx.registerService(ConsoleConstants.INTERFACE_SERVLET, new ServiceFactory()
        {
            public void ungetService(final Bundle bundle, final ServiceRegistration registration, final Object service)
            {
                // nothing to do
View Full Code Here

    protected void deactivate(final ComponentContext componentContext) {
        logger.debug("deactivate");
    }

    protected synchronized void configure(final ComponentContext componentContext) {
        final Dictionary properties = componentContext.getProperties();
        consumerKey = PropertiesUtil.toString(properties.get(CONSUMER_KEY_PARAMETER), "").trim();
        consumerSecret = PropertiesUtil.toString(properties.get(CONSUMER_SECRET_PARAMETER), "").trim();
        callbackUrl = PropertiesUtil.toString(properties.get(CALLBACK_URL_PARAMETER), "").trim();
        usersMeUrl = PropertiesUtil.toString(properties.get(USERS_ME_URL_PARAMETER), DEFAULT_USERS_ME_URL).trim();

        if (StringUtils.isEmpty(consumerKey)) {
            logger.warn("configured consumer key is empty");
        }
View Full Code Here

            session = null;
        }
    }

    protected synchronized void configure(final ComponentContext componentContext) {
        final Dictionary properties = componentContext.getProperties();
        autoCreateUser = PropertiesUtil.toBoolean(properties.get(AUTO_CREATE_USER_PARAMETER), DEFAULT_AUTO_CREATE_USER);
        autoUpdateUser = PropertiesUtil.toBoolean(properties.get(AUTO_UPDATE_USER_PARAMETER), DEFAULT_AUTO_UPDATE_USER);
    }
View Full Code Here

    @Test
    public void testServiceRegistration() throws InvalidSyntaxException {
        // prepare test services
        String clazz1 = String.class.getName();
        Object service1 = new Object();
        Dictionary properties1 = getServiceProperties(null);
        ServiceRegistration reg1 = this.bundleContext.registerService(clazz1, service1, properties1);

        String[] clazzes2 = new String[] { String.class.getName(), Integer.class.getName() };
        Object service2 = new Object();
        Dictionary properties2 = getServiceProperties(null);
        ServiceRegistration reg2 = this.bundleContext.registerService(clazzes2, service2, properties2);

        String clazz3 = Integer.class.getName();
        Object service3 = new Object();
        Dictionary properties3 = getServiceProperties(100L);
        ServiceRegistration reg3 = this.bundleContext.registerService(clazz3, service3, properties3);

        // test get service references
        ServiceReference refString = this.bundleContext.getServiceReference(String.class.getName());
        assertSame(reg1.getReference(), refString);
View Full Code Here

        Dictionary<String, Object> props = new Hashtable<String, Object>();
        props.put("prop1", "value1");
        props.put("prop2", 25);
        ComponentContext componentContextWithProperties = MockOsgi.newComponentContext(props);

        Dictionary contextProps = componentContextWithProperties.getProperties();
        assertEquals(2, contextProps.size());
        assertEquals("value1", contextProps.get("prop1"));
        assertEquals(25, contextProps.get("prop2"));
    }
View Full Code Here

            loginPageRegistration = null;
        }
    }

    protected void configure(final ComponentContext context) {
        final Dictionary properties = context.getProperties();
        consumerKey = PropertiesUtil.toString(properties.get(CONSUMER_KEY_PARAMETER), "").trim();
        userCookie = PropertiesUtil.toString(properties.get(USER_COOKIE_PARAMETER), DEFAULT_USER_COOKIE).trim();
        userIdCookie = PropertiesUtil.toString(properties.get(USERID_COOKIE_PARAMETER), DEFAULT_USERID_COOKIE).trim();
        maxCookieSize = PropertiesUtil.toInteger(properties.get(MAX_COOKIE_SIZE_PARAMETER), DEFAULT_MAX_COOKIE_SIZE);
        loginPath = PropertiesUtil.toString(properties.get(LOGIN_PATH_PARAMETER), "").trim();
        logoutPath = PropertiesUtil.toString(properties.get(LOGOUT_PATH_PARAMETER), "").trim();

        if (StringUtils.isEmpty(consumerKey)) {
            logger.warn("configured consumer key is empty");
            xingCookie = "";
        } else {
View Full Code Here

            session = null;
        }
    }

    protected synchronized void configure(final ComponentContext componentContext) {
        final Dictionary properties = componentContext.getProperties();
        secretKey = PropertiesUtil.toString(properties.get(SECRET_KEY_PARAMETER), "").trim();
        userDataProperty = PropertiesUtil.toString(properties.get(USER_DATA_PROPERTY_PARAMETER), DEFAULT_USER_DATA_PROPERTY).trim();
        userHashProperty = PropertiesUtil.toString(properties.get(USER_HASH_PROPERTY_PARAMETER), DEFAULT_USER_HASH_PROPERTY).trim();
        autoCreateUser = PropertiesUtil.toBoolean(properties.get(AUTO_CREATE_USER_PARAMETER), DEFAULT_AUTO_CREATE_USER);
        autoUpdateUser = PropertiesUtil.toBoolean(properties.get(AUTO_UPDATE_USER_PARAMETER), DEFAULT_AUTO_UPDATE_USER);

        if (StringUtils.isEmpty(secretKey)) {
            logger.warn("configured secret key is empty");
        }
    }
View Full Code Here

    /**
     * Activate
     */
    @Activate
    protected void activate(final ComponentContext ctx) {
        final Dictionary props = ctx.getProperties();

        this.allowEmpty = PropertiesUtil.toBoolean(props.get(PROP_ALLOW_EMPTY), DEFAULT_ALLOW_EMPTY);

        final String[] allowRegexHosts = defaultIfEmpty(PropertiesUtil.toStringArray(props.get(PROP_HOSTS_REGEX),
                DEFAULT_PROP_HOSTS), DEFAULT_PROP_HOSTS);
        this.allowedRegexReferrers = createReferrerPatterns(allowRegexHosts);

        final Set<String> allowUriReferrers = getDefaultAllowedReferrers();
        final String[] allowHosts = defaultIfEmpty(PropertiesUtil.toStringArray(props.get(PROP_HOSTS),
                DEFAULT_PROP_HOSTS), DEFAULT_PROP_HOSTS);
        allowUriReferrers.addAll(Arrays.asList(allowHosts));
        this.allowedUriReferrers = createReferrerUrls(allowUriReferrers);

        this.filterMethods = PropertiesUtil.toStringArray(props.get(PROP_METHODS));
        if ( this.filterMethods != null && this.filterMethods.length == 1 && (this.filterMethods[0] == null || this.filterMethods[0].trim().length() == 0) ) {
            this.filterMethods = null;
        }
        if ( this.filterMethods != null ) {
            for(int i=0; i<filterMethods.length; i++) {
View Full Code Here

TOP

Related Classes of java.util.Dictionary

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.