Package org.atmosphere.util

Examples of org.atmosphere.util.AtmosphereConfigReader$Property


        StringBuffer url = request.getRequestURL().replace(index, request.getRequestURL().length(), newContext);
        applicationController.subscribeUserAndCreateStatistic(Long.valueOf(applicationVersionId), request);

        String itmsURL = "itms-services://?action=download-manifest&url=" + url.toString();

        Property property = new Property();
        property.setKey("URL");
        property.setValue(itmsURL);

        return property;
    }
View Full Code Here


    @RequestMapping(value = "/statistics", method = RequestMethod.GET, produces = contentType)
    public
    @ResponseBody
    Properties viewSystemManagementPage(HttpServletRequest request) {
        Property[] properties = new Property[3];
        properties[0] = new Property(SystemStatistics.ORGANIZATION_COUNT.name(), Long.toString(organizationService.countAll()), SystemStatistics.ORGANIZATION_COUNT.getDescription());
        properties[1] = new Property(SystemStatistics.USER_COUNT.name(), Long.toString(userService.countAll()), SystemStatistics.USER_COUNT.getDescription());
        properties[2] = new Property(SystemStatistics.APPLICATION_COUNT.name(), Long.toString(applicationService.countAll()), SystemStatistics.APPLICATION_COUNT.getDescription());

        Properties props = new Properties();
        props.setProperties(properties);

        return props;
View Full Code Here

        if (stream == null) {
            return;
        }

        AtmosphereConfigReader reader = new AtmosphereConfigReader(stream);

        Map<String, String> atmosphereHandlerNames = reader.getAtmosphereHandlers();
        Set<Entry<String, String>> entries = atmosphereHandlerNames.entrySet();
        for (Entry<String, String> entry : entries) {
            AtmosphereHandler handler;
            String handlerClassName = entry.getValue();
            String handlerPath = entry.getKey();

            try {
                if (!handlerClassName.equals(ReflectorServletProcessor.class.getName())) {
                    handler = (AtmosphereHandler) c.loadClass(handlerClassName).newInstance();
                    InjectorProvider.getInjector().inject(handler);
                } else {
                    handler = new ReflectorServletProcessor();
                }

                logger.info("successfully loaded handler: {} mapped to context-path: {}", handler, handlerPath);

                AtmosphereHandlerWrapper wrapper = new AtmosphereHandlerWrapper(handler);
                atmosphereHandlers.put(handlerPath, wrapper);
                boolean isJersey = false;
                for (Property p : reader.getProperty(handlerPath)) {
                    if (p.value != null && p.value.indexOf("jersey") != -1) {
                        isJersey = true;
                        initParams.put(DISABLE_ONSTATE_EVENT, "true");
                        useStreamForFlushingComments = true;
                    }
                    IntrospectionUtils.setProperty(handler, p.name, p.value);
                }

                config.supportSession = !isJersey;

                if (!reader.supportSession().equals("")) {
                    sessionSupport(Boolean.valueOf(reader.supportSession()));
                }

                for (Property p : reader.getProperty(handlerPath)) {
                    IntrospectionUtils.addProperty(handler, p.name, p.value);
                }

                String broadcasterClass = reader.getBroadcasterClass(handlerPath);
                /**
                 * If there is more than one AtmosphereHandler defined, their Broadcaster
                 * may clash each other with the BroadcasterFactory. In that case we will use the
                 * last one defined.
                 */
                if (broadcasterClass != null) {
                    broadcasterClassName = broadcasterClass;
                    ClassLoader cl = Thread.currentThread().getContextClassLoader();
                    Class<? extends Broadcaster> bc = (Class<? extends Broadcaster>) cl.loadClass(broadcasterClassName);
                    wrapper.broadcaster = BroadcasterFactory.getDefault().get(bc, handlerPath);
                }

                String bc = reader.getBroadcasterCache(handlerPath);
                if (bc != null) {
                    broadcasterCacheClassName = bc;
                }

                if (reader.getCometSupportClass() != null) {
                    cometSupport = (CometSupport) c.loadClass(reader.getCometSupportClass())
                            .getDeclaredConstructor(new Class[]{AtmosphereConfig.class})
                            .newInstance(new Object[]{config});
                }

                if (reader.getBroadcastFilterClasses() != null) {
                    broadcasterFilters = reader.getBroadcastFilterClasses();
                }

            }
            catch (Throwable t) {
                logger.warn("unable to load AtmosphereHandler class: " + handlerClassName, t);
View Full Code Here

        if (stream == null) {
            return;
        }

        AtmosphereConfigReader reader = new AtmosphereConfigReader(stream);

        Map<String, String> atmosphereHandlerNames = reader.getAtmosphereHandlers();
        Set<Entry<String, String>> entries = atmosphereHandlerNames.entrySet();
        for (Entry<String, String> entry : entries) {
            AtmosphereHandler g;
            try {
                if (!entry.getValue().equals(ReflectorServletProcessor.class.getName())) {
                    g = (AtmosphereHandler) c.loadClass(entry.getValue()).newInstance();
                } else {
                    g = new ReflectorServletProcessor();
                }
                logger.info("Sucessfully loaded " + g
                        + " mapped to context-path " + entry.getKey());

                AtmosphereHandlerWrapper wrapper = new AtmosphereHandlerWrapper(g);
                atmosphereHandlers.put(entry.getKey(), wrapper);
                boolean isJersey = false;
                for (Property p : reader.getProperty(entry.getKey())) {
                    if (p.value != null && p.value.indexOf("jersey") != -1) {
                        isJersey = true;
                        initParams.put(DISABLE_ONSTATE_EVENT, "true");
                        useStreamForFlushingComments = true;
                    }
                    IntrospectionUtils.setProperty(g, p.name, p.value);
                }

                config.supportSession = !isJersey;

                if (!reader.supportSession().equals("")) {
                    sessionSupport(Boolean.valueOf(reader.supportSession()));
                }

                for (Property p : reader.getProperty(entry.getKey())) {
                    IntrospectionUtils.addProperty(g, p.name, p.value);
                }

                String broadcasterClass = reader.getBroadcasterClass(entry.getKey());
                /**
                 * If there is more than one AtmosphereHandler defined, their Broadcaster
                 * may clash each other with the BroadcasterFactory. In that case we will use the
                 * last one defined.
                 */
                if (broadcasterClass != null) {
                    broadcasterClassName = broadcasterClass;
                    ClassLoader cl = Thread.currentThread().getContextClassLoader();
                    Class<? extends Broadcaster> bc = (Class<? extends Broadcaster>) cl.loadClass(broadcasterClassName);
                    wrapper.broadcaster = BroadcasterFactory.getDefault().get(bc, entry.getKey());
                }

                String bc = reader.getBroadcasterCache(entry.getKey());
                if (bc != null) {
                    broadcasterCacheClassName = bc;
                }

                if (reader.getCometSupportClass() != null) {
                    cometSupport = (CometSupport)
                            c.loadClass(reader.getCometSupportClass()).newInstance();
                }

                if (reader.getBroadcastFilterClasses() != null){
                    configureBroadcasterFilter(reader.getBroadcastFilterClasses());
                }

            } catch (Throwable t) {
                logger.log(Level.WARNING, "Unable to load AtmosphereHandler class: "
                        + entry.getValue(), t);
View Full Code Here

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case Bpmn2Package.PROPERTY: {
            Property property = (Property) theEObject;
            T result = caseProperty(property);
            if (result == null)
                result = caseItemAwareElement(property);
            if (result == null)
                result = caseBaseElement(property);
View Full Code Here

                    MetafacadeConstants.NAMESPACE_SCOPE_OPERATOR,
                    true);
            if (modelElement instanceof Type)
            {
                Type element = (Type)modelElement;
                final Property property = umlClass.createOwnedAttribute(
                        name,
                        element,
                        1,
                        1);
                VisibilityKind kind = VisibilityKind.PUBLIC_LITERAL;
                if (visibility.equalsIgnoreCase("package"))
                {
                    kind = VisibilityKind.PACKAGE_LITERAL;
                }
                if (visibility.equalsIgnoreCase("private"))
                {
                    kind = VisibilityKind.PRIVATE_LITERAL;
                }
                if (visibility.equalsIgnoreCase("protected"))
                {
                    kind = VisibilityKind.PROTECTED_LITERAL;
                }
                property.setVisibility(kind);
                Stereotype stereotype =
                    UmlUtilities.findApplicableStereotype(
                        property,
                        UMLProfile.STEREOTYPE_IDENTIFIER);
                if (stereotype == null)
                {
                    throw new MetafacadeException("Could not apply '" + UMLProfile.STEREOTYPE_IDENTIFIER + "' to " +
                        property + ", the stereotype could not be found");
                }
                property.apply(stereotype);
            }
        }
    }
View Full Code Here

    public boolean equals(final Object obj)
    {
        if (obj instanceof Attribute)
        {
            Property other = ((AttributeImpl)obj).property;
            return this.property.equals(other);
        }
        if (obj instanceof AssociationEnd)
        {
            Property other = ((AssociationEndImpl)obj).property;
            return this.property.equals(other);
        }
        return this.property.equals(obj);
    }
View Full Code Here

        for (final Iterator memberIterator = members.iterator(); memberIterator.hasNext();)
        {
            final Object nextCandidate = memberIterator.next();
            if (nextCandidate instanceof Property)
            {
                final Property property = (Property)nextCandidate;

                if (property.getAssociation() == null)
                {
                    if (logger.isDebugEnabled())
                    {
                        logger.debug("Attribute found for " + classifier.getName() + ": " + property.getName());
                        if (attributeMap.containsKey(property.getName()))
                        {
                            logger.warn(
                                "An attribute with this name has already been registered, overriding: " +
                                property.getName());
                        }
                    }

                    // property represents an association end
                    attributeMap.put(
                        property.getName(),
                        property);
                }
            }
        }
View Full Code Here

                Property.class,
                classifier.getModel());

        for (final Iterator propertyIterator = allProperties.iterator(); propertyIterator.hasNext();)
        {
            final Property property = (Property)propertyIterator.next();

            // only treat association ends, ignore attributes
            if (property.getAssociation() != null && isAssociationEndAttachedToType(
                    classifier,
                    property,
                    follow))
            {
                associationEnds.add(property);
View Full Code Here

            {
                for (Iterator tvIt = getAttributes(
                            stereo,
                            true).iterator(); tvIt.hasNext();)
                {
                    Property tagProperty = (Property)tvIt.next();
                    String tagName = tagProperty.getName();
                    if (!tagName.startsWith("base$"))
                    {
                        if (element.hasValue(
                                stereo,
                                tagName))
View Full Code Here

TOP

Related Classes of org.atmosphere.util.AtmosphereConfigReader$Property

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.