Package org.jvnet.hk2.config.types

Examples of org.jvnet.hk2.config.types.PropertyBag


        }
    }

    public void generateAttributeChangeEvent(String property, String propertyDetail, Map props) {
        PropertyChangeEvent pce = new PropertyChangeEvent(this, property, propertyDetail, props.get(property));
        UnprocessedChangeEvents ucel = new UnprocessedChangeEvents(new UnprocessedChangeEvent(pce, "server log file attribute " + property + " changed."));
        List<UnprocessedChangeEvents> b = new ArrayList();
        b.add(ucel);
        ucl.unprocessedTransactedEvents(b);
    }
View Full Code Here


            List<String> vsList = StringUtils.parseStringList(vsIDs, " ,");
            if (httpService != null && vsList != null && !vsList.isEmpty()) {
                for (VirtualServer vsBean : httpService.getVirtualServer()) {
                    if (vsList.contains(vsBean.getId())) {
                        Boolean csr = null;
                        Property prop = vsBean.getProperty("contextXmlDefault");
                        if (prop != null) {
                            File contextXml = new File(serverEnvironment.getInstanceRoot(),
                                    prop.getValue());
                            if (contextXml.exists()) {  // vs context.xml
                                ContextXmlParser parser = new ContextXmlParser(contextXml);
                                csr = parser.getClearReferencesStatic();
                            }
                        }
View Full Code Here

    @DuckTyped
    String getGroupMapping();

    class Duck {
        public static String getGroupMapping(AuthRealm me) {
            Property prop = me.getProperty("group-mapping"); //have to hard-code this, unfortunately :(
            if (prop != null)
                return prop.getValue();
            return null;
        }
View Full Code Here

                    jmsHost.setHost(mqhost);
                    jmsHost.setPort(mqport);
        if(props != null)
        {
          for (Map.Entry e: props.entrySet()){
        Property prop = jmsHost.createChild(Property.class);
        prop.setName((String)e.getKey());
        prop.setValue((String)e.getValue());
        jmsHost.getProperty().add(prop);
      }
        }
                    param.getJmsHost().add(jmsHost);
View Full Code Here

            Map<String, Property> existing = getExistingProperties();
            deleteMissingProperties(existing, properties);
            Map<String, String> data = new LinkedHashMap<String, String>();

            for (Map<String, String> property : properties) {
                Property existingProp = existing.get(property.get("name"));
                String escapedName = getEscapedPropertyName(property.get("name"));
                String value = property.get("value");
                String description = property.get("description");
                final String unescapedValue = value.replaceAll("\\\\", "");

                // the prop name can not contain .
                // need to remove the . test when http://java.net/jira/browse/GLASSFISH-15418  is fixed
                boolean canSaveDesc = property.get("name").indexOf(".") == -1;

                if ((existingProp == null) || !unescapedValue.equals(existingProp.getValue())) {
                    data.put(escapedName, property.get("value"));
                    if (canSaveDesc && (description != null)) {
                        data.put(escapedName + ".description", description);
                    }
                }

                //update the description only if not null/blank
                if ((description != null) && (existingProp != null)) {
                     if (!"".equals(description) && (!description.equals(existingProp.getDescription()))) {
                        if (canSaveDesc) {
                            data.put(escapedName + ".description", description);
                        }
                    }
                }
View Full Code Here

    protected Map<String, Property> getExistingProperties() {
        Map<String, Property> properties = new HashMap<>();
        if (parent != null) {
            for (Dom child : parent.nodeElements(tagName)) {
                Property property = child.createProxy();
                properties.put(property.getName(), property);
            }
        }
        return properties;
    }
View Full Code Here

    private void createVirtualServerProperty(VirtualServer vs) throws PropertyVetoException {
        while (!(parser.getEventType() == END_ELEMENT && parser.getLocalName().equals("virtual-server"))) {
            try {
                if (parser.next() == START_ELEMENT) {
                    if (parser.getLocalName().equals("property")) {
                        Property p = vs.createChild(Property.class);
                        vs.getProperty().add(p);
                        createProperty(p);
                    }
                }
            } catch (TransactionFailure ex) {
View Full Code Here

    protected void updatePropertyToAttribute(final AdminCommandContext context, final ConfigBeanProxy target,
        final String property, final String attribute)
        throws TransactionFailure {
        ConfigSupport.apply(new SingleConfigCode<ConfigBeanProxy>() {
            public Object run(ConfigBeanProxy param) {
                PropertyBag bag = (PropertyBag) param;
                final List<Property> propertyList = new ArrayList<Property>(bag.getProperty());
                setProperty(target, attribute, getValue(propertyList, property));
                final String message = MessageFormat.format("Moved {0}.property.{1} to {0}.{2}",
                    Dom.convertName(Dom.unwrap(target).getProxyType().getSimpleName()),
                    property,
                    Dom.convertName(attribute));
                report(context, message);
                bag.getProperty().clear();
                bag.getProperty().addAll(propertyList);
                return param;
            }
        }, target);
    }
View Full Code Here

    protected void removeProperty(final ConfigBeanProxy target, final String property)
        throws TransactionFailure {
        ConfigSupport.apply(new SingleConfigCode<ConfigBeanProxy>() {
            public Object run(ConfigBeanProxy param) {
                PropertyBag bag = (PropertyBag) param;
                final List<Property> propertyList = new ArrayList<Property>(bag.getProperty());
                final Iterator<Property> it = propertyList.iterator();
                boolean done = false;
                while (!done && it.hasNext()) {
                    Property prop = it.next();
                    if (property.equals(prop.getName())) {
                        done = true;
                        it.remove();
                    }
                }
                bag.getProperty().clear();
                bag.getProperty().addAll(propertyList);
                return param;
            }
        }, target);
    }
View Full Code Here

    }

    public static boolean isDynamicReconfigurationEnabled(ResourcePool pool){
        boolean enabled = false;
        if(pool instanceof PropertyBag){
            PropertyBag properties = (PropertyBag)pool;
            Property property = properties.getProperty(ConnectorConstants.DYNAMIC_RECONFIGURATION_FLAG);
            if(property != null){
                try{
                    if(Long.parseLong(property.getValue()) > 0){
                        enabled = true;
                    }
View Full Code Here

TOP

Related Classes of org.jvnet.hk2.config.types.PropertyBag

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.