001: /*
002: * Copyright 2002-2007 the original author or authors.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016:
017: package org.springframework.web.portlet.context;
018:
019: import javax.portlet.PortletConfig;
020: import javax.portlet.PortletContext;
021:
022: import org.springframework.context.ConfigurableApplicationContext;
023: import org.springframework.web.context.WebApplicationContext;
024:
025: /**
026: * Interface to be implemented by configurable portlet application contexts.
027: * Supported by {@link org.springframework.web.portlet.FrameworkPortlet}.
028: *
029: * <p>Note: The setters of this interface need to be called before an
030: * invocation of the {@link #refresh} method inherited from
031: * {@link org.springframework.context.ConfigurableApplicationContext}.
032: * They do not cause an initialization of the context on their own.
033: *
034: * @author Juergen Hoeller
035: * @author William G. Thompson, Jr.
036: * @author John A. Lewis
037: * @since 2.0
038: * @see #refresh
039: * @see org.springframework.web.context.ContextLoader#createWebApplicationContext
040: * @see org.springframework.web.portlet.FrameworkPortlet#createPortletApplicationContext
041: * @see org.springframework.web.context.ConfigurableWebApplicationContext
042: */
043: public interface ConfigurablePortletApplicationContext extends
044: WebApplicationContext, ConfigurableApplicationContext {
045:
046: /**
047: * Any number of these characters are considered delimiters between
048: * multiple context paths in a single String value.
049: * @see org.springframework.web.portlet.FrameworkPortlet#setContextConfigLocation
050: */
051: String CONFIG_LOCATION_DELIMITERS = ",; \t\n";
052:
053: /**
054: * Set the PortletContext for this portlet application context.
055: * <p>Does not cause an initialization of the context: refresh needs to be
056: * called after the setting of all configuration properties.
057: * @see #refresh()
058: */
059: void setPortletContext(PortletContext portletContext);
060:
061: /**
062: * Return the standard Portlet API PortletContext for this application.
063: */
064: PortletContext getPortletContext();
065:
066: /**
067: * Set the PortletConfig for this portlet application context.
068: * @see #refresh()
069: */
070: void setPortletConfig(PortletConfig portletConfig);
071:
072: /**
073: * Return the PortletConfig for this portlet application context, if any.
074: */
075: PortletConfig getPortletConfig();
076:
077: /**
078: * Set the namespace for this portlet application context,
079: * to be used for building a default context config location.
080: */
081: void setNamespace(String namespace);
082:
083: /**
084: * Return the namespace for this web application context, if any.
085: */
086: String getNamespace();
087:
088: /**
089: * Set the config locations for this portlet application context.
090: * If not set, the implementation is supposed to use a default for the
091: * given namespace.
092: */
093: void setConfigLocations(String[] configLocations);
094:
095: /**
096: * Return the config locations for this web application context,
097: * or <code>null</code> if none specified.
098: */
099: String[] getConfigLocations();
100:
101: }
|