Package org.directwebremoting.extend

Examples of org.directwebremoting.extend.CreatorManager


    /**
     * Defines each SCA service proxy instance to DWR
     */
    private void initServices() {
        CreatorManager creatorManager = (CreatorManager)getContainer().getBean(CreatorManager.class.getName());

        for (final ServiceHolder holder : services.values()) {
            creatorManager.addCreator(holder.name, new AbstractCreator() {
                public Class getType() {
                    return holder.type;
                }

                public Object getInstance() throws InstantiationException {
View Full Code Here


    /**
     * Add an SCA service to be added to the DWR runtime
     */
    public void addService(RuntimeEndpointReference epr) {
       
        CreatorManager creatorManager = (CreatorManager)getContainer().getBean(CreatorManager.class.getName());
        addService(creatorManager, epr);
        serviceRefs.put(epr.getReference().getName(), epr);
    }
View Full Code Here

    /**
     * Defines each SCA service proxy instance to DWR
     */
    protected void initServices() {
        CreatorManager creatorManager = (CreatorManager)getContainer().getBean(CreatorManager.class.getName());

        for (final ServiceHolder holder : services.values()) {
            creatorManager.addCreator(holder.name, new AbstractCreator() {
                public Class getType() {
                    return holder.type;
                }

                public Object getInstance() throws InstantiationException {
View Full Code Here

    /**
     * Defines each SCA service proxy instance to DWR
     */
    private void initServices() {
        CreatorManager creatorManager = (CreatorManager)getContainer().getBean(CreatorManager.class.getName());

        for (final ServiceHolder holder : services.values()) {
            creatorManager.addCreator(holder.name, new AbstractCreator() {
                public Class getType() {
                    return holder.type;
                }

                public Object getInstance() throws InstantiationException {
View Full Code Here

    public void configure(Container container)
    {
        AccessControl accessControl = container.getBean(AccessControl.class);
        AjaxFilterManager ajaxFilterManager = container.getBean(AjaxFilterManager.class);
        ConverterManager converterManager = container.getBean(ConverterManager.class);
        CreatorManager creatorManager = container.getBean(CreatorManager.class);

        // Configure the global filters
        if (null != filters)
        {
            for (AjaxFilter filter : filters)
            {
                ajaxFilterManager.addAjaxFilter(filter);
            }
        }

        // Configure the creator types
        if (creatorTypes != null)
        {
            for (Entry<String, String> entry : creatorTypes.entrySet())
            {
                String typeName = entry.getKey();
                String className = entry.getValue();

                creatorManager.addCreatorType(typeName, className);
            }
        }

        // Configure the converter types
        if (converterTypes != null)
        {
            for (Entry<String, String> entry : converterTypes.entrySet())
            {
                String typeName = entry.getKey();
                String className = entry.getValue();

                converterManager.addConverterType(typeName, className);
            }
        }

        // Configure the creators
        if (creators != null)
        {
            try
            {
                for (Entry<String, CreatorConfig> entry : creators.entrySet())
                {
                    String scriptName = entry.getKey();
                    CreatorConfig creatorConfig = entry.getValue();

                    if (creatorConfig.getCreator() != null)
                    {
                        Creator creator = creatorConfig.getCreator();
                        creatorManager.addCreator(creator);
                    }
                    else
                    {
                        String creatorName = creatorConfig.getCreatorType();
                        Map<String, String> params = creatorConfig.getParams();
                        creatorManager.addCreator(creatorName, params);
                    }

                    for (String exclude : creatorConfig.getExcludes())
                    {
                        accessControl.addExcludeRule(scriptName, exclude);
View Full Code Here

    protected void processCreate(Class<?> clazz, RemoteProxy createAnn, Container container)
    {
        Class<? extends Creator> creatorClass = createAnn.creator();
        String creatorClassName = creatorClass.getName();

        CreatorManager creatorManager = container.getBean(CreatorManager.class);

        // Add a phony creator type just so we are able to do addCreator with the params collection later
        String creatorName = creatorClassName.replace(".", "_");
        creatorManager.addCreatorType(creatorName, creatorClassName);

        // Set up the params map from specific attributes and parameter attribute annotations
        Map<String, String> params = new HashMap<String, String>();
        params.putAll(getParamsMap(createAnn.creatorParams()));
        if (createAnn.name() != null && !createAnn.name().equals(""))
        {
            params.put("javascript", createAnn.name());
        }
        params.put("scope", createAnn.scope().getValue());

        // Add default class (remoted class)
        if (params.get("class") == null)
        {
            params.put("class", clazz.getName());
        }

        // Add default scriptName
        String scriptName = params.get("javascript");
        if (scriptName == null || scriptName.equals(""))
        {
            scriptName = clazz.getSimpleName();
            params.put("javascript", scriptName);
        }

        try
        {
            Loggers.STARTUP.debug("Adding class " + clazz.getName() + " as " + scriptName);
            creatorManager.addCreator(creatorName, params);
        }
        catch (Exception ex)
        {
            Loggers.STARTUP.error("Failed to add class as Creator: " + clazz.getName(), ex);
        }
View Full Code Here

            ConverterManager converterManager = container.getBean(ConverterManager.class);
            Loggers.STARTUP.debug("ConverterManager");
            Loggers.STARTUP.debug("  Type: " + converterManager.getClass().getName());

            // CreatorManager debugging
            CreatorManager creatorManager = container.getBean(CreatorManager.class);
            Loggers.STARTUP.debug("CreatorManager");
            Loggers.STARTUP.debug("  Type: " + creatorManager.getClass().getName());
            for (String creatorName : creatorManager.getCreatorNames(false))
            {
                Creator creator = creatorManager.getCreator(creatorName, false);
                Loggers.STARTUP.debug("  Creator: " + creatorName + " = " + creator + " (" + creator.getClass().getName() + ")");
            }

            // ModuleManager debugging
            ModuleManager moduleManager = container.getBean(ModuleManager.class);
View Full Code Here

    /**
     * Defines each SCA service proxy instance to DWR
     */
    protected void initServices() {
        CreatorManager creatorManager = (CreatorManager)getContainer().getBean(CreatorManager.class.getName());

        for (final ServiceHolder holder : services.values()) {
            creatorManager.addCreator(holder.name, new AbstractCreator() {
                public Class getType() {
                    return holder.type;
                }

                public Object getInstance() throws InstantiationException {
View Full Code Here

    /**
     * Defines each SCA service proxy instance to DWR
     */
    private void initServices() {
        CreatorManager creatorManager = (CreatorManager)getContainer().getBean(CreatorManager.class.getName());

        for (final ServiceHolder holder : services.values()) {
            creatorManager.addCreator(holder.name, new AbstractCreator() {
                public Class getType() {
                    return holder.type;
                }

                public Object getInstance() throws InstantiationException {
View Full Code Here

    /**
     * Defines each SCA service proxy instance to DWR
     */
    private void initServices() {
        CreatorManager creatorManager = (CreatorManager)getContainer().getBean(CreatorManager.class.getName());

        for (final ServiceHolder holder : services.values()) {
            creatorManager.addCreator(holder.name, new AbstractCreator() {
                public Class getType() {
                    return holder.type;
                }

                public Object getInstance() throws InstantiationException {
View Full Code Here

TOP

Related Classes of org.directwebremoting.extend.CreatorManager

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.