Package com.opensymphony.xwork2.inject

Examples of com.opensymphony.xwork2.inject.Factory


        // Initialize ActionContext
        ConfigurationManager configurationManager = new ConfigurationManager();
        configurationManager.addContainerProvider(new XWorkConfigurationProvider());
        Configuration config = configurationManager.getConfiguration();
        Container container = config.getContainer();

        ValueStack stack = container.getInstance(ValueStackFactory.class).createValueStack();
        stack.getContext().put(ActionContext.CONTAINER, container);
        ActionContext.setContext(new ActionContext(stack.getContext()));

        ActionContext.getContext().setSession(new HashMap<String, Object>());
View Full Code Here


        FilterDispatcher filterDispatcher = new FilterDispatcher() {
            @Override
            protected Dispatcher createDispatcher(FilterConfig cfg) {
                return new Dispatcher(cfg.getServletContext(), new HashMap()) {
                    Container cont = new ContainerBuilder()
                        .factory(ObjectFactory.class, new Factory() {
                            public Object create(Context context) throws Exception { return destroyedObjectFactory; }
                        })
                        .create(false);
                   
                    @Override
View Full Code Here

     * @see com.opensymphony.xwork2.config.providers.XmlConfigurationProvider#register(com.opensymphony.xwork2.inject.ContainerBuilder, java.util.Properties)
     */
    @Override
    public void register(ContainerBuilder containerBuilder, LocatableProperties props) throws ConfigurationException {
        if (servletContext != null && !containerBuilder.contains(ServletContext.class)) {
            containerBuilder.factory(ServletContext.class, new Factory() {
                public Object create(Context context) throws Exception {
                    return servletContext;
                }
               
            });
View Full Code Here

        FilterDispatcher filterDispatcher = new FilterDispatcher() {
            @Override
            protected Dispatcher createDispatcher(FilterConfig cfg) {
                return new Dispatcher(cfg.getServletContext(), new HashMap()) {
                    Container cont = new ContainerBuilder()
                        .factory(ObjectFactory.class, new Factory() {
                            public Object create(Context context) throws Exception { return destroyedObjectFactory; }
                        })
                        .create(false);
                   
                    @Override
View Full Code Here

        FilterDispatcher filterDispatcher = new FilterDispatcher() {
            @Override
            protected Dispatcher createDispatcher(FilterConfig cfg) {
                return new Dispatcher(cfg.getServletContext(), new HashMap()) {
                    Container cont = new ContainerBuilder()
                        .factory(ObjectFactory.class, new Factory() {
                            public Object create(Context context) throws Exception { return destroyedObjectFactory; }
                        })
                        .create(false);
                   
                    @Override
View Full Code Here

     * @see com.opensymphony.xwork2.config.providers.XmlConfigurationProvider#register(com.opensymphony.xwork2.inject.ContainerBuilder, java.util.Properties)
     */
    @Override
    public void register(ContainerBuilder containerBuilder, LocatableProperties props) throws ConfigurationException {
        if (servletContext != null && !containerBuilder.contains(ServletContext.class)) {
            containerBuilder.factory(ServletContext.class, new Factory() {
                public Object create(Context context) throws Exception {
                    return servletContext;
                }
               
            });
View Full Code Here

    protected void loadButAdd(final Class<?> type, final String name, final Object impl) {
        loadConfigurationProviders(new StubConfigurationProvider() {
            @Override
            public void register(ContainerBuilder builder,
                                 LocatableProperties props) throws ConfigurationException {
                builder.factory(type, name, new Factory() {
                    public Object create(Context context) throws Exception {
                        return impl;
                    }

                }, Scope.SINGLETON);
View Full Code Here

       
        loadSettings(props, settings);
       
        // Set default locale
        final Locale locale = settings.getLocale();
        builder.factory(Locale.class, new Factory() {
            public Object create(Context context) throws Exception {
                return locale;
            }
        });
    }
View Full Code Here

     * @see com.opensymphony.xwork2.config.providers.XmlConfigurationProvider#register(com.opensymphony.xwork2.inject.ContainerBuilder, java.util.Properties)
     */
    @Override
    public void register(ContainerBuilder containerBuilder, LocatableProperties props) throws ConfigurationException {
        if (servletContext != null && !containerBuilder.contains(ServletContext.class)) {
            containerBuilder.factory(ServletContext.class, new Factory() {
                public Object create(Context context) throws Exception {
                    return servletContext;
                }
               
            });
View Full Code Here

        FilterDispatcher filterDispatcher = new FilterDispatcher() {
            @Override
            protected Dispatcher createDispatcher(FilterConfig cfg) {
                return new Dispatcher(cfg.getServletContext(), new HashMap()) {
                    Container cont = new ContainerBuilder()
                        .factory(ObjectFactory.class, new Factory() {
                            public Object create(Context context) throws Exception { return destroyedObjectFactory; }
                        })
                        .create(false);
                   
                    @Override
View Full Code Here

TOP

Related Classes of com.opensymphony.xwork2.inject.Factory

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.